2015-09-21 17:59:03 +02:00
|
|
|
class PieceJustificative < ActiveRecord::Base
|
|
|
|
belongs_to :dossier
|
|
|
|
belongs_to :type_de_piece_justificative
|
2016-01-18 16:20:51 +01:00
|
|
|
|
2015-09-21 17:59:03 +02:00
|
|
|
delegate :api_entreprise, :libelle, to: :type_de_piece_justificative
|
2016-01-18 16:20:51 +01:00
|
|
|
|
2015-09-21 17:59:03 +02:00
|
|
|
alias_attribute :type, :type_de_piece_justificative_id
|
2016-01-18 16:20:51 +01:00
|
|
|
|
2015-09-21 17:59:03 +02:00
|
|
|
mount_uploader :content, PieceJustificativeUploader
|
2016-02-19 14:12:06 +01:00
|
|
|
validates :content, :file_size => { :maximum => 3.megabytes }
|
2015-09-21 17:59:03 +02:00
|
|
|
|
|
|
|
def empty?
|
|
|
|
content.blank?
|
|
|
|
end
|
|
|
|
end
|