Merge pull request #7035 from adullact/fix/7034-after-party-dossier-traitement

Échec de la tâche AfterParty add_traitements_from_dossiers
This commit is contained in:
LeSim 2022-03-17 10:07:09 +01:00 committed by GitHub
commit fc5847803c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ namespace :after_party do
dossiers_termines = Dossier.state_termine
progress = ProgressReport.new(dossiers_termines.count)
dossiers_termines.find_each do |dossier|
dossier.traitements.create!(state: dossier.state, motivation: dossier.motivation, processed_at: dossier.processed_at)
dossier.traitements.find_or_create_by!(state: dossier.state, motivation: dossier.motivation, processed_at: dossier.processed_at)
progress.inc
end
progress.finish