demarches-normaliennes/app/models/champs/siret_champ.rb

46 lines
1.1 KiB
Ruby
Raw Normal View History

2018-04-03 16:29:42 +02:00
class Champs::SiretChamp < Champ
2018-04-03 17:53:14 +02:00
ETABLISSEMENT_ATTRIBUTES = [
:id,
:_destroy,
:signature,
:siret,
:siege_social,
:naf,
:libelle_naf,
:adresse,
:numero_voie,
:type_voie,
:nom_voie,
:code_postal,
:localite,
:code_insee_localite,
:entreprise_siren,
:entreprise_capital_social,
:entreprise_numero_tva_intracommunautaire,
:entreprise_forme_juridique,
:entreprise_forme_juridique_code,
:entreprise_nom_commercial,
:entreprise_raison_sociale,
:entreprise_siret_siege_social,
:entreprise_code_effectif_entreprise,
:entreprise_date_creation,
:entreprise_nom,
:entreprise_prenom,
:association_rna,
:association_titre,
:association_objet,
:association_date_creation,
:association_date_declaration,
:association_date_publication,
exercices_attributes: [
[:id, :ca, :date_fin_exercice, :date_fin_exercice_timestamp]
]
]
2018-04-03 16:29:42 +02:00
accepts_nested_attributes_for :etablissement, allow_destroy: true, update_only: true
def search_terms
etablissement.present? ? etablissement.search_terms : [value]
end
2018-04-03 16:29:42 +02:00
end