From 73cdcca0225efba0cc5f92ec7d0a0fc92c44e8f2 Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Sat, 13 May 2023 15:43:52 +0100 Subject: [PATCH] fix linter issues --- app/models/invoice/data_presenter.rb | 3 ++- app/services/order_tax_adjustments_fetcher.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/invoice/data_presenter.rb b/app/models/invoice/data_presenter.rb index c8aa8aef54..e8c7b3656b 100644 --- a/app/models/invoice/data_presenter.rb +++ b/app/models/invoice/data_presenter.rb @@ -11,7 +11,8 @@ class Invoice extend Invoice::DataPresenterAttributes attributes :additional_tax_total, :currency, :included_tax_total, :payment_total, - :shipping_method_id, :state, :total, :number, :note, :special_instructions, :completed_at + :shipping_method_id, :state, :total, :number, :note, :special_instructions, + :completed_at attributes_with_presenter :bill_address, :customer, :distributor, :ship_address, :shipping_method, :order_cycle diff --git a/app/services/order_tax_adjustments_fetcher.rb b/app/services/order_tax_adjustments_fetcher.rb index 97254a928c..72a20a2257 100644 --- a/app/services/order_tax_adjustments_fetcher.rb +++ b/app/services/order_tax_adjustments_fetcher.rb @@ -7,8 +7,8 @@ class OrderTaxAdjustmentsFetcher @order = order end - def totals(tax_adjustments = nil) - (tax_adjustments ||= order.all_adjustments.tax).each_with_object({}) do |adjustment, hash| + def totals(tax_adjustments = order.all_adjustments.tax) + tax_adjustments.each_with_object({}) do |adjustment, hash| tax_rate = adjustment.originator hash[tax_rate] = hash[tax_rate].to_f + adjustment.amount end