diff --git a/app/controllers/statement_of_works_controller.rb b/app/controllers/statement_of_works_controller.rb index 1ffb710..3a42806 100644 --- a/app/controllers/statement_of_works_controller.rb +++ b/app/controllers/statement_of_works_controller.rb @@ -44,7 +44,7 @@ def set_statement_of_work def statement_of_work_params params.require(:statement_of_work).permit(:model, :hourly_revenue, :total_revenue, :total_hours, - :hour_delivery_schedule, :limit_by_delivery_schedule, + :hour_delivery_schedule, :start_date, :end_date, :name) end end diff --git a/app/models/statement_of_work.rb b/app/models/statement_of_work.rb index ffb243a..6b24d3f 100644 --- a/app/models/statement_of_work.rb +++ b/app/models/statement_of_work.rb @@ -4,21 +4,20 @@ # # Table name: statement_of_works # -# id :bigint not null, primary key -# contract_model_type :string -# end_date :datetime -# hour_delivery_schedule :string -# hourly_revenue :float -# limit_by_delivery_schedule :boolean default(TRUE), not null -# model :string -# name :string -# start_date :datetime -# total_hours :float -# total_revenue :float -# created_at :datetime not null -# updated_at :datetime not null -# contract_model_id :integer -# project_id :bigint not null +# id :bigint not null, primary key +# contract_model_type :string +# end_date :datetime +# hour_delivery_schedule :string +# hourly_revenue :float +# model :string +# name :string +# start_date :datetime +# total_hours :float +# total_revenue :float +# created_at :datetime not null +# updated_at :datetime not null +# contract_model_id :integer +# project_id :bigint not null # # Indexes # diff --git a/app/views/statement_of_works/_statement_of_work.json.jbuilder b/app/views/statement_of_works/_statement_of_work.json.jbuilder index 3177ff1..0408a57 100644 --- a/app/views/statement_of_works/_statement_of_work.json.jbuilder +++ b/app/views/statement_of_works/_statement_of_work.json.jbuilder @@ -1,4 +1,4 @@ # frozen_string_literal: true json.extract! statement_of_work, :id, :model, :hourly_revenue, :total_revenue, :total_hours, :hour_delivery_schedule, - :limit_by_delivery_schedule, :start_date, :end_date, :project_id, :created_at, :updated_at, :name + :start_date, :end_date, :project_id, :created_at, :updated_at, :name diff --git a/db/migrate/20240123171117_remove_limit_by_delivery_schedule_from_sow.rb b/db/migrate/20240123171117_remove_limit_by_delivery_schedule_from_sow.rb new file mode 100644 index 0000000..852364b --- /dev/null +++ b/db/migrate/20240123171117_remove_limit_by_delivery_schedule_from_sow.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RemoveLimitByDeliveryScheduleFromSow < ActiveRecord::Migration[7.0] + def change + remove_column :statement_of_works, :limit_by_delivery_schedule, :boolean + end +end diff --git a/db/schema.rb b/db/schema.rb index b20ab88..0a0270d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_01_23_170606) do +ActiveRecord::Schema[7.0].define(version: 2024_01_23_171117) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -180,7 +180,6 @@ t.float "total_revenue" t.float "total_hours" t.string "hour_delivery_schedule" - t.boolean "limit_by_delivery_schedule", default: true, null: false t.datetime "start_date" t.datetime "end_date" t.bigint "project_id", null: false diff --git a/spec/factories/statement_of_works.rb b/spec/factories/statement_of_works.rb index 5888856..c65b2a6 100644 --- a/spec/factories/statement_of_works.rb +++ b/spec/factories/statement_of_works.rb @@ -4,21 +4,20 @@ # # Table name: statement_of_works # -# id :bigint not null, primary key -# contract_model_type :string -# end_date :datetime -# hour_delivery_schedule :string -# hourly_revenue :float -# limit_by_delivery_schedule :boolean default(TRUE), not null -# model :string -# name :string -# start_date :datetime -# total_hours :float -# total_revenue :float -# created_at :datetime not null -# updated_at :datetime not null -# contract_model_id :integer -# project_id :bigint not null +# id :bigint not null, primary key +# contract_model_type :string +# end_date :datetime +# hour_delivery_schedule :string +# hourly_revenue :float +# model :string +# name :string +# start_date :datetime +# total_hours :float +# total_revenue :float +# created_at :datetime not null +# updated_at :datetime not null +# contract_model_id :integer +# project_id :bigint not null # # Indexes # @@ -42,7 +41,6 @@ total_hours { 120 } total_revenue { 12_000 } hour_delivery_schedule { 'monthly' } - limit_by_delivery_schedule { true } end trait :with_time_and_materials do @@ -51,7 +49,6 @@ total_hours { 120 } total_revenue { 12_000 } hour_delivery_schedule { 'contract_period' } - limit_by_delivery_schedule { true } end trait :with_fixed_bid do @@ -60,7 +57,6 @@ total_hours { nil } total_revenue { 12_000 } hour_delivery_schedule { 'contract_period' } - limit_by_delivery_schedule { false } end end end diff --git a/spec/models/statement_of_work_spec.rb b/spec/models/statement_of_work_spec.rb index 29a1dc3..f6038ae 100644 --- a/spec/models/statement_of_work_spec.rb +++ b/spec/models/statement_of_work_spec.rb @@ -4,21 +4,20 @@ # # Table name: statement_of_works # -# id :bigint not null, primary key -# contract_model_type :string -# end_date :datetime -# hour_delivery_schedule :string -# hourly_revenue :float -# limit_by_delivery_schedule :boolean default(TRUE), not null -# model :string -# name :string -# start_date :datetime -# total_hours :float -# total_revenue :float -# created_at :datetime not null -# updated_at :datetime not null -# contract_model_id :integer -# project_id :bigint not null +# id :bigint not null, primary key +# contract_model_type :string +# end_date :datetime +# hour_delivery_schedule :string +# hourly_revenue :float +# model :string +# name :string +# start_date :datetime +# total_hours :float +# total_revenue :float +# created_at :datetime not null +# updated_at :datetime not null +# contract_model_id :integer +# project_id :bigint not null # # Indexes #