Fix easy rubocop issues

This commit is contained in:
Luis Ramos
2020-09-05 16:43:04 +01:00
parent fe7cf0cf44
commit 4b597ada12
4 changed files with 12 additions and 12 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)