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.
 
 
 
 

21 lines
851 B

require "helpers/invalid_logs_helper"
namespace :logs do
desc "Count the number of invalid LettingsLog and SalesLog for a given year"
task :count_invalid, [:year] => :environment do |_task, args|
include CollectionTimeHelper
year = args[:year] || current_collection_year
InvalidLogsHelper.count_and_display_invalid_logs(LettingsLog, "LettingsLog", year)
InvalidLogsHelper.count_and_display_invalid_logs(SalesLog, "SalesLog", year)
end
desc "Surface all invalid logs and output their error messages for a given year"
task :surface_invalid, [:year] => :environment do |_task, args|
include CollectionTimeHelper
year = args[:year] || current_collection_year
InvalidLogsHelper.surface_invalid_logs(LettingsLog, "LettingsLog", year)
InvalidLogsHelper.surface_invalid_logs(SalesLog, "SalesLog", year)
end
end