Skip to content

Commit

Permalink
Исправлены замечания по миграциям и по контроллеру interviews/index
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon committed Jul 30, 2020
1 parent ad373a3 commit 80ecead
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/web/controllers/interviews/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class Index
def call(params)
result = interview_operation.call(company_id: params[:company_id].to_i)
company_result = operation.call(id: params[:company_id].to_i)
case result && company_result
case company_result
when Success
@interviews = result.value_or([])
@company = company_result.value!
@interviews = result.value_or([])
when Failure
redirect_to routes.companies_path
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
change do
alter_table :companies do
add_column :interview_rating_total, Float, null: false, default: 0.0
add_column :interview_ratings, 'jsonb', default: '{}', null: false
add_column :interviews, 'jsonb', default: '{}', null: false
end
end
end
7 changes: 7 additions & 0 deletions db/migrations/20200730182023_change_fields_in_companies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Hanami::Model.migration do
change do
alter_table :companies do
rename_column :interviews, :interview_ratings
end
end
end

0 comments on commit 80ecead

Please sign in to comment.