Merge pull request #7328 from betagouv/sentry/3002560608

sentry(3002560608): some Dossier ready to be purged are missing the hidden_by_reason
This commit is contained in:
mfo 2022-05-16 21:22:27 +02:00 committed by GitHub
commit 624c250982
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,14 @@
namespace :after_party do
desc 'Deployment task: fix_hidden_by_reason_nil'
task fix_hidden_by_reason_nil: :environment do
puts "Running deploy task 'fix_hidden_by_reason_nil'"
# Put your task implementation HERE.
Dossier.en_construction_expired_to_delete.where(hidden_by_reason: nil).update_all(hidden_by_reason: :user_request)
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end