Skip to content

Commit

Permalink
Change state default
Browse files Browse the repository at this point in the history
This sets a default on the database so we don't need to set one when we
stop using the field.
  • Loading branch information
thomasleese committed Sep 29, 2023
1 parent 522cbe4 commit 500c896
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/models/further_information_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# working_days_assessment_started_to_creation :integer
# working_days_received_to_recommendation :integer
# working_days_since_received :integer
Expand Down
2 changes: 1 addition & 1 deletion app/models/professional_standing_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion app/models/qualification_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion app/models/reference_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# satisfied_comment :text default(""), not null
# satisfied_response :boolean
# slug :string not null
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
20 changes: 20 additions & 0 deletions db/migrate/20230926142509_change_requestables_state_default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class ChangeRequestablesStateDefault < ActiveRecord::Migration[7.0]
def change
change_column_default :further_information_requests,
:state,
from: nil,
to: "requested"
change_column_default :professional_standing_requests,
:state,
from: nil,
to: "requested"
change_column_default :qualification_requests,
:state,
from: nil,
to: "requested"
change_column_default :reference_requests,
:state,
from: nil,
to: "requested"
end
end
10 changes: 5 additions & 5 deletions db/schema.rb

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

2 changes: 1 addition & 1 deletion spec/factories/further_information_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# working_days_assessment_started_to_creation :integer
# working_days_received_to_recommendation :integer
# working_days_since_received :integer
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/professional_standing_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/qualification_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/reference_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# satisfied_comment :text default(""), not null
# satisfied_response :boolean
# slug :string not null
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion spec/models/further_information_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# working_days_assessment_started_to_creation :integer
# working_days_received_to_recommendation :integer
# working_days_since_received :integer
Expand Down
2 changes: 1 addition & 1 deletion spec/models/professional_standing_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion spec/models/qualification_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
2 changes: 1 addition & 1 deletion spec/models/reference_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# satisfied_comment :text default(""), not null
# satisfied_response :boolean
# slug :string not null
# state :string not null
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down

0 comments on commit 500c896

Please sign in to comment.