Use #all_adjustments scope

Some of the way these objects are returned by different scopes will be changing soon. This ensures we should get the same results.
This commit is contained in:
Matt-Yorkley
2021-02-22 16:00:22 +00:00
parent 20f4a5359e
commit ecf4332527

View File

@@ -8,10 +8,10 @@ class PaypalItemsBuilder
def call
items = order.line_items.map(&method(:line_item_data))
tax_adjustments = order.adjustments.tax
shipping_adjustments = order.adjustments.shipping
tax_adjustments = order.all_adjustments.tax
shipping_adjustments = order.all_adjustments.shipping
order.adjustments.eligible.each do |adjustment|
order.all_adjustments.eligible.each do |adjustment|
next if (tax_adjustments + shipping_adjustments).include?(adjustment)
items << adjustment_data(adjustment)