Skip to content

Commit

Permalink
Fix easy rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
luisramos0 committed Sep 5, 2020
1 parent 68c8308 commit 880e01f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/models/spree/line_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ def amount
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
Expand Down
14 changes: 7 additions & 7 deletions app/models/spree/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,27 @@ def currency
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
Expand Down Expand Up @@ -266,7 +266,7 @@ def tax_address
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

Expand Down
4 changes: 2 additions & 2 deletions app/models/spree/order_inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def remove(line_item, variant_units, shipment = nil)
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
Expand Down
10 changes: 5 additions & 5 deletions app/models/spree/payment/processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ def gateway_options
# For more information, please see Spree::Payment#set_unique_identifier
order_id: gateway_order_id }

options.merge!({ shipping: order.ship_total * 100,
tax: order.tax_total * 100,
subtotal: order.item_total * 100,
discount: 0,
currency: currency })
options.merge!(shipping: order.ship_total * 100,
tax: order.tax_total * 100,
subtotal: order.item_total * 100,
discount: 0,
currency: currency)

options.merge!({ billing_address: order.bill_address.try(:active_merchant_hash),
shipping_address: order.ship_address.try(:active_merchant_hash) })
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/return_authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def currency
end

def display_amount
Spree::Money.new(amount, { currency: currency })
Spree::Money.new(amount, currency: currency)
end

def add_variant(variant_id, quantity)
Expand Down

0 comments on commit 880e01f

Please sign in to comment.