fix(after_party): use find_or_create_by to respect idempotency
instead of create!
This commit is contained in:
parent
9d5db6e276
commit
021bdd4db6
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue