Skip to content

Commit 63b936a

Browse files
committed
Revert "Take list into apply method"
This reverts commit da17630.
1 parent 8b5f35c commit 63b936a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ecommerce/pricing/lib/pricing/offer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def initialize(id)
1111
@discounts = []
1212
@state = :draft
1313

14-
@three_plus_one_gratis = Discounts::ThreePlusOneGratis.new
14+
@three_plus_one_gratis = Discounts::ThreePlusOneGratis.new(@list)
1515
end
1616

1717
def add_item(product_id, base_price)
@@ -26,8 +26,8 @@ def add_item(product_id, base_price)
2626
total_value: @list.actual_sum + price
2727
}
2828
)
29-
30-
anything_applied = @three_plus_one_gratis.apply(@list)
29+
30+
anything_applied = @three_plus_one_gratis.apply(base_price)
3131
apply DiscountApplied.new(
3232
data: {
3333
order_id: @id,

0 commit comments

Comments
 (0)