From a609990ca4cedd4b8e32a3bf9b002208b6ebb918 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Fri, 8 Sep 2023 13:31:51 +0100 Subject: [PATCH] Remove application_forms:enable_preliminary_checks This task isn't used anymore and it doesn't work correctly. It's been replaced by the `backfill_preliminary_checks` tasks. --- lib/tasks/application_forms.rake | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lib/tasks/application_forms.rake b/lib/tasks/application_forms.rake index 174950f355..e2142f060a 100644 --- a/lib/tasks/application_forms.rake +++ b/lib/tasks/application_forms.rake @@ -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