From 3bb2ae27f75afee78c7bab7eba1e8cd6292764ae Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Thu, 16 Apr 2026 18:38:41 +0100 Subject: [PATCH] fixup! CLDC-4436: Add a script to recalculate LA of logs in a year report count both before and after processing --- lib/tasks/search_for_la_on_logs_with_nil_la.rake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/tasks/search_for_la_on_logs_with_nil_la.rake b/lib/tasks/search_for_la_on_logs_with_nil_la.rake index 462ed6a88..d851183fd 100644 --- a/lib/tasks/search_for_la_on_logs_with_nil_la.rake +++ b/lib/tasks/search_for_la_on_logs_with_nil_la.rake @@ -6,8 +6,10 @@ task :search_for_la_on_logs_with_nil_la, [:year] => :environment do |_task, args lettings_logs = LettingsLog.filter_by_year(year).where(la: nil, needstype: 1, status: "completed") sales_logs = LettingsLog.filter_by_year(year).where(la: nil, status: "completed") + lettings_logs_count = lettings_logs.count + sales_logs_count = sales_logs.count - puts "Checking LA on #{lettings_logs.count} lettings logs in #{year}" + puts "Checking LA on #{lettings_logs_count} lettings logs in #{year}" i = 0 lettings_logs.find_each do |log| @@ -24,7 +26,9 @@ task :search_for_la_on_logs_with_nil_la, [:year] => :environment do |_task, args end end - puts "Checking LA on #{sales_logs.count} sales logs in #{year}" + puts "Done #{lettings_logs_count} lettings logs" + + puts "Checking LA on #{sales_logs_count} sales logs in #{year}" i = 0 sales_logs.find_each do |log| @@ -41,5 +45,7 @@ task :search_for_la_on_logs_with_nil_la, [:year] => :environment do |_task, args end end + puts "Done #{sales_logs_count} sales logs" + puts "Done" end