Skip to content

Commit

Permalink
Add statuses column
Browse files Browse the repository at this point in the history
This adds a new column on application forms for tracking the various
statuses an application form is currently in. This will eventually
replace the `status` and `waiting_on`, `received` and `overdue` columns.
  • Loading branch information
thomasleese committed Sep 27, 2023
1 parent fbaa384 commit e35d379
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# requires_preliminary_check :boolean default(FALSE), not null
# stage :string default("draft"), not null
# status :string default("draft"), not null
# statuses :string default(["\"draft\""]), not null, is an Array
# subjects :text default([]), not null, is an Array
# subjects_status :string default("not_started"), not null
# submitted_at :datetime
Expand Down
1 change: 1 addition & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
- reviewer_id
- stage
- status
- statuses
- subjects
- subjects_status
- submitted_at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddStatusesToApplicationForms < ActiveRecord::Migration[7.0]
class AddSectionStatusesToApplicationForms < ActiveRecord::Migration[7.0]
def change
change_table :application_forms, bulk: true do |t|
t.string :personal_information_status, default: "not_started", null: false
Expand Down
10 changes: 10 additions & 0 deletions db/migrate/20230914104107_add_statuses_to_application_forms.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddStatusesToApplicationForms < ActiveRecord::Migration[7.0]
def change
add_column :application_forms,
:statuses,
:string,
default: %w[draft],
array: true,
null: false
end
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spec/factories/application_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# requires_preliminary_check :boolean default(FALSE), not null
# stage :string default("draft"), not null
# status :string default("draft"), not null
# statuses :string default(["\"draft\""]), not null, is an Array
# subjects :text default([]), not null, is an Array
# subjects_status :string default("not_started"), not null
# submitted_at :datetime
Expand Down
1 change: 1 addition & 0 deletions spec/models/application_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# requires_preliminary_check :boolean default(FALSE), not null
# stage :string default("draft"), not null
# status :string default("draft"), not null
# statuses :string default(["\"draft\""]), not null, is an Array
# subjects :text default([]), not null, is an Array
# subjects_status :string default("not_started"), not null
# submitted_at :datetime
Expand Down

0 comments on commit e35d379

Please sign in to comment.