demarches-normaliennes/app/models/entreprise.rb

19 lines
404 B
Ruby
Raw Normal View History

2015-08-10 11:05:06 +02:00
class Entreprise < ActiveRecord::Base
belongs_to :dossier
has_one :etablissement, dependent: :destroy
has_one :rna_information, dependent: :destroy
2016-08-02 14:45:09 +02:00
validates_presence_of :siren
validates_uniqueness_of :dossier_id
2016-08-30 11:18:43 +02:00
2018-02-22 16:53:29 +01:00
accepts_nested_attributes_for :rna_information
2016-08-30 11:18:43 +02:00
before_save :default_values
def default_values
self.raison_sociale ||= ''
end
2018-02-22 16:53:29 +01:00
attr_writer :mandataires_sociaux
2015-08-10 11:05:06 +02:00
end