diff --git a/lib/in_progress_form_status_default.rb b/lib/in_progress_form_status_default.rb new file mode 100644 index 00000000000..7ec746d57d4 --- /dev/null +++ b/lib/in_progress_form_status_default.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module DataMigrations + module InProgressFormStatusDefault + module_function + + def run + InProgressForm.where(status: nil).update_all(status: 'pending') # rubocop:disable Rails/SkipsModelValidations + end + end +end diff --git a/rakelib/in_progress_forms_status_change.rake b/rakelib/in_progress_forms_status_change.rake new file mode 100644 index 00000000000..1d5f6d06691 --- /dev/null +++ b/rakelib/in_progress_forms_status_change.rake @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +namespace :data_migration do + task in_progress_forms_status: :environment do + DataMigrations::InProgressFormStatusDefault.run + end +end