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 11, 2023
1 parent a6719ff commit c0501e2
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 @@ -47,4 +47,15 @@ namespace :application_forms do
puts "#{application_form.reference}: #{application_form.status}"
end
end

desc "Turn on preliminary checks for draft or submitted applications."
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.status} - #{application_form.actionable_by}"
end
end
end

0 comments on commit c0501e2

Please sign in to comment.