3c57643f76
add factory girl fix tests rename dossier_pdf into piece_jointe rename ref_piece_jointe into content
14 lines
347 B
Ruby
14 lines
347 B
Ruby
class Dossier < ActiveRecord::Base
|
|
has_one :etablissement
|
|
has_one :entreprise
|
|
has_many :pieces_jointes
|
|
belongs_to :ref_formulaire
|
|
has_many :commentaires
|
|
|
|
delegate :siren, to: :entreprise
|
|
delegate :siret, to: :etablissement
|
|
|
|
def get_pj piece_jointe_id
|
|
pieces_jointes.where(ref_pieces_jointes_id: piece_jointe_id).last
|
|
end
|
|
end
|