Style/ReduceToHash

This commit is contained in:
Maikel Linke
2026-04-02 12:19:22 +11:00
parent 473fff1bb8
commit d1c045cbf0
2 changed files with 4 additions and 4 deletions

View File

@@ -133,8 +133,8 @@ class Invoice
end
def tax_rate_by_id
all_tax_adjustments.each_with_object({}) do |adjustment, tax_rates|
tax_rates[adjustment.originator.id] = adjustment.originator
all_tax_adjustments.to_h do |adjustment|
[adjustment.originator.id, adjustment.originator]
end
end

View File

@@ -41,8 +41,8 @@ module OpenFoodNetwork
end
def fees_name_by_type_for(variant)
per_item_enterprise_fee_applicators_for(variant).each_with_object({}) do |applicator, fees|
fees[applicator.enterprise_fee.fee_type.to_sym] = applicator.enterprise_fee.name
per_item_enterprise_fee_applicators_for(variant).to_h do |applicator|
[applicator.enterprise_fee.fee_type.to_sym, applicator.enterprise_fee.name]
end
end