Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review/interview show #80

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Sim0n-White
Copy link

Добавлено отображение интервью и тесты к ним

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так нельзя делать, этот код всегда будет company_result пропускать

по идее, ты можешь переписать это вот так:

case company_result
when Success
  @company = company_result.value!
  @interviews = result.value_or([])
when Failure
  redirect_to routes.companies_path
end

@@ -4,7 +4,7 @@
change do
alter_table :companies do
add_column :interview_rating_total, Float, null: false, default: 0.0
add_column :interviews, 'jsonb', default: '{}', null: false
add_column :interview_ratings, 'jsonb', default: '{}', null: false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так нельзя делать. нужно делать новую миграцию, в которой будет переименнована колонка

https://guides.hanamirb.org/migrations/alter-table/#methods

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

при этом, зачем тебе тут jsonb поле?

@Sim0n-White Sim0n-White force-pushed the review/interview_show branch from 9344c14 to 80ecead Compare July 30, 2020 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants