From 7fcf56638223aa8d1f29267f3ce19fcf97fc885a Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 16 May 2022 18:02:09 +0200 Subject: [PATCH] sentry(3002560608): some Dossier ready to be purged are missing the hidden_by_reason --- .../20220516160033_fix_hidden_by_reason_nil.rake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/tasks/deployment/20220516160033_fix_hidden_by_reason_nil.rake diff --git a/lib/tasks/deployment/20220516160033_fix_hidden_by_reason_nil.rake b/lib/tasks/deployment/20220516160033_fix_hidden_by_reason_nil.rake new file mode 100644 index 000000000..d63976fee --- /dev/null +++ b/lib/tasks/deployment/20220516160033_fix_hidden_by_reason_nil.rake @@ -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