demarches-normaliennes/app/models/piece_justificative.rb

16 lines
407 B
Ruby
Raw Normal View History

class PieceJustificative < ActiveRecord::Base
belongs_to :dossier
belongs_to :type_de_piece_justificative
delegate :api_entreprise, :libelle, to: :type_de_piece_justificative
alias_attribute :type, :type_de_piece_justificative_id
mount_uploader :content, PieceJustificativeUploader
2016-02-18 15:46:59 +01:00
validates :content, :file_size => { :maximum => 3.megabytes.to_i }
def empty?
content.blank?
end
end