Validates commentaire file size
This commit is contained in:
parent
76cb54988d
commit
6c39aba978
2 changed files with 6 additions and 0 deletions
|
@ -4,6 +4,7 @@ class Commentaire < ActiveRecord::Base
|
||||||
belongs_to :piece_justificative
|
belongs_to :piece_justificative
|
||||||
|
|
||||||
mount_uploader :file, CommentaireFileUploader
|
mount_uploader :file, CommentaireFileUploader
|
||||||
|
validates :file, file_size: { maximum: 20.megabytes, message: "La taille du fichier doit être inférieure à 20 Mo" }
|
||||||
validate :is_virus_free?
|
validate :is_virus_free?
|
||||||
|
|
||||||
default_scope { order(created_at: :asc) }
|
default_scope { order(created_at: :asc) }
|
||||||
|
|
5
config/locales/models/commentaire/fr.yml
Normal file
5
config/locales/models/commentaire/fr.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
fr:
|
||||||
|
activerecord:
|
||||||
|
attributes:
|
||||||
|
commentaire:
|
||||||
|
file: fichier
|
Loading…
Reference in a new issue