Skip to content

Commit

Permalink
Remove application_forms:enable_preliminary_checks
Browse files Browse the repository at this point in the history
This task isn't used anymore and it doesn't work correctly. It's been replaced by the `backfill_preliminary_checks` tasks.
  • Loading branch information
thomasleese committed Sep 11, 2023
1 parent d01077c commit a609990
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions lib/tasks/application_forms.rake
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,4 @@ namespace :application_forms do
count = BackfillPreliminaryChecks.call(user:)
puts "Updated #{count} applications."
end

desc "Turn on preliminary checks for draft or submitted applications."
task :enable_preliminary_checks,
%i[country_code staff_email] => :environment do |_task, args|
application_forms =
ApplicationForm.joins(region: :country).where(
requires_preliminary_check: false,
status: %w[draft submitted],
countries: {
code: args[:country_code],
},
)

puts "This will change #{application_forms.count} applications. Are you sure you want to continue?"
$stdin.gets.chomp

user = Staff.find_by!(email: args[:staff_email])

application_forms.find_each do |application_form|
application_form.update!(requires_preliminary_check: true)
ApplicationFormStatusUpdater.call(application_form:, user:)
puts "#{application_form.reference}: #{application_form.status}"
end
end
end

0 comments on commit a609990

Please sign in to comment.