Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
annvelents committed Jan 7, 2025
1 parent 1515a83 commit 8d3de8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/services/customers/manage_invoice_custom_sections_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def call
if !section_ids.nil? || !section_codes.nil?
customer.skip_invoice_custom_sections = false
return result if customer.applicable_invoice_custom_sections.ids == section_ids ||
customer.applicable_invoice_custom_sections.map(&:code) == section_codes
customer.applicable_invoice_custom_sections.map(&:code) == section_codes

assign_selected_sections
end
Expand All @@ -50,11 +50,11 @@ def raise_invalid_params

def assign_selected_sections
# Note: when assigning organization's sections, an empty array will be sent
unless section_ids.nil?
customer.selected_invoice_custom_sections = customer.organization.invoice_custom_sections.where(id: section_ids)
else
customer.selected_invoice_custom_sections = customer.organization.invoice_custom_sections.where(code: section_codes)
if section_ids.nil?
return customer.selected_invoice_custom_sections = customer.organization.invoice_custom_sections.where(code: section_codes)
end

customer.selected_invoice_custom_sections = customer.organization.invoice_custom_sections.where(id: section_ids)
end
end
end
2 changes: 1 addition & 1 deletion spec/requests/api/v1/customers_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
sections = json[:customer][:applicable_invoice_custom_sections]
expect(sections).to be_present
expect(sections.length).to eq(2)
expect(sections.map{|sec| sec[:code]}).to eq(invoice_custom_sections.map(&:code))
expect(sections.map { |sec| sec[:code] }).to eq(invoice_custom_sections.map(&:code))
end
end

Expand Down
1 change: 0 additions & 1 deletion spec/services/customers/create_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@
expect(customer.skip_invoice_custom_sections).to eq(false)
end
end

end

context 'when customer already exists' do
Expand Down

0 comments on commit 8d3de8e

Please sign in to comment.