amelioration(data): backfill procedure_expires_when_termine_enabled:true pour les procedures ou c'est pas activé qui n'ont pas de dossiers

This commit is contained in:
Martin 2023-11-09 16:01:17 +01:00 committed by mfo
parent 1716a931c5
commit 5bf38ea06f

View file

@ -0,0 +1,13 @@
namespace :after_party do
desc 'Deployment task: backfill_procedure_expires_when_termine_enabled_without_dossiers'
task backfill_procedure_expires_when_termine_enabled_without_dossiers: :environment do
puts "Running deploy task 'backfill_procedure_expires_when_termine_enabled_without_dossiers'"
Procedure.where.missing(:dossiers)
.where(procedure_expires_when_termine_enabled: false)
.update_all(procedure_expires_when_termine_enabled: true)
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end