From 08666cd8522765a7e4c2394d74c2168d491b103e Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 2 Mar 2023 17:16:52 +0100 Subject: [PATCH] fix(dossier): fix again hidden_by_reason nil to fix Cron::DiscardedDossiersDeletionJob --- ...30302161322_fix_again_hidden_by_reason_nil.rake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/tasks/deployment/20230302161322_fix_again_hidden_by_reason_nil.rake diff --git a/lib/tasks/deployment/20230302161322_fix_again_hidden_by_reason_nil.rake b/lib/tasks/deployment/20230302161322_fix_again_hidden_by_reason_nil.rake new file mode 100644 index 000000000..9871eec45 --- /dev/null +++ b/lib/tasks/deployment/20230302161322_fix_again_hidden_by_reason_nil.rake @@ -0,0 +1,14 @@ +namespace :after_party do + desc 'Deployment task: fix_again_hidden_by_reason_nil' + task fix_again_hidden_by_reason_nil: :environment do + puts "Running deploy task 'fix_again_hidden_by_reason_nil'" + + Dossier.en_construction_expired_to_delete.where(hidden_by_reason: nil).update_all(hidden_by_reason: :user_request) + Dossier.termine_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