add SIRETService
This commit is contained in:
parent
da14cceadc
commit
896518f3d5
8 changed files with 68 additions and 64 deletions
|
@ -4,6 +4,9 @@ class Etablissement < ActiveRecord::Base
|
|||
|
||||
has_many :exercices, dependent: :destroy
|
||||
|
||||
accepts_nested_attributes_for :exercices
|
||||
accepts_nested_attributes_for :entreprise
|
||||
|
||||
validates_uniqueness_of :dossier_id
|
||||
|
||||
def geo_adresse
|
||||
|
@ -14,4 +17,14 @@ class Etablissement < ActiveRecord::Base
|
|||
# squeeze needed because of space in excess in the data
|
||||
"#{numero_voie} #{type_voie} #{nom_voie}, #{complement_adresse}, #{code_postal} #{localite}".squeeze(' ')
|
||||
end
|
||||
|
||||
attr_accessor :entreprise_mandataires_sociaux
|
||||
|
||||
def mandataire_social?(france_connect_information)
|
||||
if france_connect_information.present?
|
||||
entreprise_mandataires_sociaux&.find do |mandataire|
|
||||
france_connect_information.mandataire_social?(mandataire)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue