From 6f63b6b2fb4cc25d70e4e8c604828f5553cfa44d Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Wed, 1 Apr 2026 15:29:08 +0100 Subject: [PATCH] CLDC-4250: Add a post release script --- .../update_logs_with_invalid_hb_benefits_2026.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake diff --git a/lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake b/lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake new file mode 100644 index 000000000..4770db96a --- /dev/null +++ b/lib/tasks/update_logs_with_invalid_hb_benefits_2026.rake @@ -0,0 +1,10 @@ +desc "For logs that fail the validate_housing_universal_credit_matches_income_proportion check created before we released it, clear the answer to the question" +task update_logs_with_invalid_hb_benefits_2026: :environment do + impacted_logs = LettingsLog.filter_by_year(2026).where(hb: 6, benefits: 3) + + puts "#{impacted_logs.count} logs will be updated #{impacted_logs.map(&:id)}" + + impacted_logs.update!(benefits: nil, hb: nil) + + puts "Done" +end