Skip to content

Commit

Permalink
remove google id database constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Jan 25, 2024
1 parent 5d26d99 commit e07cdc7
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/models/retainer_contract_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# id :bigint not null, primary key
# charge_upfront :boolean default(FALSE), not null
# expected_hours_per_period :float
# expected_hours_per_period :float default(0.0)
# revenue_per_period :float
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
1 change: 0 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# Indexes
#
# index_users_on_email (email) UNIQUE
# index_users_on_google_id (google_id) UNIQUE
# index_users_on_profession_id (profession_id)
# index_users_on_slug (slug) UNIQUE
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def assigned_expected_income(_assignment)

def expected_hours(assignment)
statement_of_work_total_hours = assignment.requirement.statement_of_work.contract_model.expected_hours_per_period
return super if statement_of_work_total_hours.nil?
return super if statement_of_work_total_hours.nil? || statement_of_work_total_hours.zero?

statement_of_work_total_hours * assignment.coverage
end
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240125200817_remove_index_users_on_google_id.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveIndexUsersOnGoogleId < ActiveRecord::Migration[7.0]
def change
remove_index :users, name: :index_users_on_google_id
end
end
6 changes: 2 additions & 4 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/retainer_contract_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# id :bigint not null, primary key
# charge_upfront :boolean default(FALSE), not null
# expected_hours_per_period :float
# expected_hours_per_period :float default(0.0)
# revenue_per_period :float
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
1 change: 0 additions & 1 deletion spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# Indexes
#
# index_users_on_email (email) UNIQUE
# index_users_on_google_id (google_id) UNIQUE
# index_users_on_profession_id (profession_id)
# index_users_on_slug (slug) UNIQUE
#
Expand Down
2 changes: 1 addition & 1 deletion spec/models/retainer_contract_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# id :bigint not null, primary key
# charge_upfront :boolean default(FALSE), not null
# expected_hours_per_period :float
# expected_hours_per_period :float default(0.0)
# revenue_per_period :float
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
1 change: 0 additions & 1 deletion spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# Indexes
#
# index_users_on_email (email) UNIQUE
# index_users_on_google_id (google_id) UNIQUE
# index_users_on_profession_id (profession_id)
# index_users_on_slug (slug) UNIQUE
#
Expand Down

0 comments on commit e07cdc7

Please sign in to comment.