add files validations to models
This commit is contained in:
parent
84c54f7271
commit
1f27652cd3
6 changed files with 39 additions and 7 deletions
|
@ -10,9 +10,8 @@ class AttestationTemplate < ApplicationRecord
|
|||
has_one_attached :signature
|
||||
|
||||
validates :footer, length: { maximum: 190 }
|
||||
|
||||
validates :logo, content_type: [:png, :jpg, :jpeg]
|
||||
validates :signature, content_type: [:png, :jpg, :jpeg]
|
||||
validates :logo, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 1.megabytes }
|
||||
validates :signature, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 1.megabytes }
|
||||
|
||||
DOSSIER_STATE = Dossier.states.fetch(:accepte)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue