Skip to content

Commit

Permalink
Add application_form:update_statuses
Browse files Browse the repository at this point in the history
This is a Rake task which will go through each application form and
ensure that it's got the latest accurate status.
  • Loading branch information
thomasleese committed Sep 24, 2023
1 parent 6ec3e2e commit 88c18b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/tasks/application_forms.rake
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@ namespace :application_forms do
count = BackfillPreliminaryChecks.call(user:)
puts "Updated #{count} applications."
end

desc "Update the statuses of all application forms."
task :update_statuses, %i[staff_email] => :environment do |_task, args|
user = Staff.find_by!(email: args[:staff_email])
ApplicationForm
.order(:id)
.find_each do |application_form|
ApplicationFormStatusUpdater.call(application_form:, user:)
puts "#{application_form.reference}: #{application_form.action_required_by} - #{application_form.status}"
end
end
end

0 comments on commit 88c18b3

Please sign in to comment.