Skip to content

Commit

Permalink
Remove state column
Browse files Browse the repository at this point in the history
This removes the column from all the requestables as we're no longer
using it for anything and it can be safely removed.
  • Loading branch information
thomasleese committed Sep 27, 2023
1 parent aca1a5c commit 15493e3
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 37 deletions.
1 change: 0 additions & 1 deletion app/models/further_information_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# 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
1 change: 0 additions & 1 deletion app/models/professional_standing_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
1 change: 0 additions & 1 deletion app/models/qualification_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
1 change: 0 additions & 1 deletion app/models/reference_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
# satisfied_comment :text default(""), not null
# satisfied_response :boolean
# slug :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
4 changes: 0 additions & 4 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
- received_at
- requested_at
- reviewed_at
- state
- updated_at
- working_days_assessment_started_to_creation
- working_days_received_to_recommendation
Expand Down Expand Up @@ -221,7 +220,6 @@
- received_at
- requested_at
- reviewed_at
- state
- updated_at
:qualifications:
- id
Expand All @@ -247,7 +245,6 @@
- received_at
- requested_at
- reviewed_at
- state
- updated_at
:reference_requests:
- additional_information_response
Expand Down Expand Up @@ -279,7 +276,6 @@
- satisfied_comment
- satisfied_response
- slug
- state
- updated_at
- work_history_id
:regions:
Expand Down
24 changes: 24 additions & 0 deletions db/migrate/20230926162102_remove_state_from_requestables.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class RemoveStateFromRequestables < ActiveRecord::Migration[7.0]
def change
remove_column :further_information_requests,
:state,
type: :string,
null: false,
default: "requested"
remove_column :professional_standing_requests,
:state,
type: :string,
null: false,
default: "requested"
remove_column :qualification_requests,
:state,
type: :string,
null: false,
default: "requested"
remove_column :reference_requests,
:state,
type: :string,
null: false,
default: "requested"
end
end
6 changes: 1 addition & 5 deletions db/schema.rb

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

1 change: 0 additions & 1 deletion spec/factories/further_information_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# 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
1 change: 0 additions & 1 deletion spec/factories/professional_standing_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
1 change: 0 additions & 1 deletion spec/factories/qualification_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
1 change: 0 additions & 1 deletion spec/factories/reference_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
# satisfied_comment :text default(""), not null
# satisfied_response :boolean
# slug :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
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@

it { is_expected.to be true }

it "doesn't change the state" do
expect { save }.to_not change(requestable, :state)
end

it "sets ready for review" do
expect { save }.to change(requestable, :ready_for_review).to(true)
end
Expand All @@ -81,10 +77,6 @@

it { is_expected.to be true }

it "doesn't change the state" do
expect { save }.to_not change(requestable, :state)
end

it "doesn't set ready for review" do
expect { save }.to_not change(requestable, :ready_for_review)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@

it { is_expected.to be true }

it "doesn't change the state" do
expect { save }.to_not change(requestable, :state)
end

it "sets passed" do
expect { save }.to change(requestable, :passed).to(false)
end
Expand All @@ -149,10 +145,6 @@

it { is_expected.to be true }

it "doesn't change the state" do
expect { save }.to_not change(requestable, :state)
end

it "doesn't set passed" do
expect { save }.to_not change(requestable, :passed)
end
Expand Down
1 change: 0 additions & 1 deletion spec/models/further_information_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# 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
1 change: 0 additions & 1 deletion spec/models/professional_standing_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
1 change: 0 additions & 1 deletion spec/models/qualification_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# received_at :datetime
# requested_at :datetime
# reviewed_at :datetime
# state :string default("requested"), not null
# created_at :datetime not null
# updated_at :datetime not null
# assessment_id :bigint not null
Expand Down
1 change: 0 additions & 1 deletion spec/models/reference_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
# satisfied_comment :text default(""), not null
# satisfied_response :boolean
# slug :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 15493e3

Please sign in to comment.