Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Nov 29, 2023
1 parent baa6064 commit 05cf98a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions app/controllers/api/v1/import/cases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ def create

@case.tries.first.update(params_to_use[:try].except(:curator_variables, :search_endpoint))

unless params_to_use[:try][:curator_variables].nil?
params_to_use[:try][:curator_variables].each do |curator_variable|
# not sure why curator_variables.build and then the @case.save doesn't cascade down.
@case.tries.first.curator_variables.create curator_variable
end
params_to_use[:try][:curator_variables]&.each do |curator_variable|
# not sure why curator_variables.build and then the @case.save doesn't cascade down.
@case.tries.first.curator_variables.create curator_variable
end

if @case.save
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/api/v1/import/cases_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CasesControllerTest < ActionController::TestCase
post :create, params: { case: data, format: :json }

assert_response :created

kase = Case.find_by(case_name: 'test case')
assert_not_nil kase
kase.owner = user
Expand Down

0 comments on commit 05cf98a

Please sign in to comment.