Merge pull request #5410 from tchak/fix-revision-migration-job

Fix revision migration job
This commit is contained in:
Paul Chavard 2020-07-23 10:51:43 +02:00 committed by GitHub
commit fb3e69aa2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,7 @@ class TmpDossiersMigrateRevisionsJob < ApplicationJob
.limit(2000)
.find_each do |dossier|
if dossier.procedure.present?
dossier.revision = dossier.procedure.active_revision
dossier.save!(validate: false)
dossier.update_column(:revision_id, dossier.procedure.active_revision_id)
else
except << dossier.id
end