Handle upload file size limit in UI

This commit is contained in:
Guillaume Lazzara 2016-02-18 15:46:59 +01:00
parent 534e041e1b
commit a643f34621
7 changed files with 90 additions and 9 deletions

View file

@ -7,6 +7,7 @@ class PieceJustificative < ActiveRecord::Base
alias_attribute :type, :type_de_piece_justificative_id
mount_uploader :content, PieceJustificativeUploader
validates :content, :file_size => { :maximum => 3.megabytes.to_i }
def empty?
content.blank?