Extract code in a #handle_legacy_models! method
This commit is contained in:
parent
68c9849977
commit
54ab0ec5f0
1 changed files with 10 additions and 6 deletions
|
@ -16,12 +16,7 @@ class SIRETService
|
|||
|
||||
# This is to fill legacy models and relationships
|
||||
if dossier.present?
|
||||
params[:entreprise_attributes] = entreprise_params.merge(
|
||||
{
|
||||
dossier: dossier,
|
||||
rna_information_attributes: association_params.presence
|
||||
}.compact
|
||||
)
|
||||
handle_legacy_models!(params, entreprise_params, dossier, association_params)
|
||||
end
|
||||
|
||||
params
|
||||
|
@ -31,4 +26,13 @@ class SIRETService
|
|||
def self.siren(siret)
|
||||
siret[0..8]
|
||||
end
|
||||
|
||||
def self.handle_legacy_models!(params, entreprise_params, dossier, association_params)
|
||||
params[:entreprise_attributes] = entreprise_params.merge(
|
||||
{
|
||||
dossier: dossier,
|
||||
rna_information_attributes: association_params.presence
|
||||
}.compact
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue