Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 lines
471 B

desc "Remaps hhregresstill values for manually created 2025/26 sales logs"
task remap_2025_hhregresstill_values: :environment do
logs = SalesLog.filter_by_year(2025).where(bulk_upload_id: nil).where(hhregresstill: [5, 6, 7])
puts "Updating #{logs.count} sales logs"
logs.where(hhregresstill: 5).update_all(hhregresstill: 10)
logs.where(hhregresstill: 6).update_all(hhregresstill: 9)
logs.where(hhregresstill: 7).update_all(hhregresstill: 9)
puts "Done"
end