[#2772] Let migrator instantiate mapping from provided class

This commit is contained in:
Frederic Merizen 2018-10-09 20:06:11 +02:00
parent 968ccce7f0
commit 6a3f7438d5
2 changed files with 2 additions and 2 deletions

View file

@ -100,7 +100,7 @@ namespace :'2018_07_31_nutriscore' do
target_tdc.champ.create(dossier: d, value: JSON.unparse(['FRANCE']))
end
end
end.new(source_procedure, destination_procedure)
end
Tasks::DossierProcedureMigrator.new(source_procedure, destination_procedure, mapping).migrate_procedure
AutoReceiveDossiersForProcedureJob.set(cron: "* * * * *").perform_later(destination_procedure_id, 'accepte')

View file

@ -117,7 +117,7 @@ module Tasks
def initialize(source_procedure, destination_procedure, champ_mapping)
@source_procedure = source_procedure
@destination_procedure = destination_procedure
@champ_mapping = champ_mapping
@champ_mapping = champ_mapping.new(source_procedure, destination_procedure)
end
def migrate_procedure