2015-08-10 11:05:06 +02:00
|
|
|
class Entreprise < ActiveRecord::Base
|
2016-11-07 17:23:58 +01:00
|
|
|
|
2015-08-10 11:05:06 +02:00
|
|
|
belongs_to :dossier
|
2016-06-20 13:57:57 +02:00
|
|
|
has_one :etablissement, dependent: :destroy
|
|
|
|
has_one :rna_information, dependent: :destroy
|
2016-08-02 14:45:09 +02:00
|
|
|
|
|
|
|
validates_presence_of :siren
|
2016-10-05 14:28:10 +02:00
|
|
|
validates_uniqueness_of :dossier_id
|
2016-08-30 11:18:43 +02:00
|
|
|
|
|
|
|
before_save :default_values
|
|
|
|
|
|
|
|
def default_values
|
|
|
|
self.raison_sociale ||= ''
|
|
|
|
end
|
2015-08-10 11:05:06 +02:00
|
|
|
end
|