mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix easy rubocop issues
This commit is contained in:
@@ -121,12 +121,12 @@ module Spree
|
||||
alias total amount
|
||||
|
||||
def single_money
|
||||
Spree::Money.new(price, { currency: currency })
|
||||
Spree::Money.new(price, currency: currency)
|
||||
end
|
||||
alias single_display_amount single_money
|
||||
|
||||
def money
|
||||
Spree::Money.new(amount, { currency: currency })
|
||||
Spree::Money.new(amount, currency: currency)
|
||||
end
|
||||
alias display_total money
|
||||
alias display_amount money
|
||||
|
||||
@@ -180,27 +180,27 @@ module Spree
|
||||
end
|
||||
|
||||
def display_outstanding_balance
|
||||
Spree::Money.new(outstanding_balance, { currency: currency })
|
||||
Spree::Money.new(outstanding_balance, currency: currency)
|
||||
end
|
||||
|
||||
def display_item_total
|
||||
Spree::Money.new(item_total, { currency: currency })
|
||||
Spree::Money.new(item_total, currency: currency)
|
||||
end
|
||||
|
||||
def display_adjustment_total
|
||||
Spree::Money.new(adjustment_total, { currency: currency })
|
||||
Spree::Money.new(adjustment_total, currency: currency)
|
||||
end
|
||||
|
||||
def display_tax_total
|
||||
Spree::Money.new(tax_total, { currency: currency })
|
||||
Spree::Money.new(tax_total, currency: currency)
|
||||
end
|
||||
|
||||
def display_ship_total
|
||||
Spree::Money.new(ship_total, { currency: currency })
|
||||
Spree::Money.new(ship_total, currency: currency)
|
||||
end
|
||||
|
||||
def display_total
|
||||
Spree::Money.new(total, { currency: currency })
|
||||
Spree::Money.new(total, currency: currency)
|
||||
end
|
||||
|
||||
def to_param
|
||||
@@ -266,7 +266,7 @@ module Spree
|
||||
def line_item_adjustment_totals
|
||||
Hash[line_item_adjustments.eligible.group_by(&:label).map do |label, adjustments|
|
||||
total = adjustments.sum(&:amount)
|
||||
[label, Spree::Money.new(total, { currency: currency })]
|
||||
[label, Spree::Money.new(total, currency: currency)]
|
||||
end]
|
||||
end
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ module Spree
|
||||
if shipment.present?
|
||||
remove_from_shipment(shipment, line_item.variant, quantity)
|
||||
else
|
||||
order.shipments.each do |shipment|
|
||||
order.shipments.each do |each_shipment|
|
||||
break if quantity == 0
|
||||
|
||||
quantity -= remove_from_shipment(shipment, line_item.variant, quantity)
|
||||
quantity -= remove_from_shipment(each_shipment, line_item.variant, quantity)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ module Spree
|
||||
end
|
||||
|
||||
def display_amount
|
||||
Spree::Money.new(amount, { currency: currency })
|
||||
Spree::Money.new(amount, currency: currency)
|
||||
end
|
||||
|
||||
def add_variant(variant_id, quantity)
|
||||
|
||||
Reference in New Issue
Block a user