Class: Spree::OrderPromotionSubscriber

Inherits:
Object
  • Object
show all
Includes:
Omnes::Subscriber
Defined in:
app/subscribers/spree/order_promotion_subscriber.rb

Overview

Clears promotions from an emptied order

Instance Method Summary collapse

Instance Method Details

#clear_order_promotions(event) ⇒ Object

Clears all promotions from the order

Parameters:

  • event (Omnes::UnstructuredEvent)


15
16
17
18
# File 'app/subscribers/spree/order_promotion_subscriber.rb', line 15

def clear_order_promotions(event)
  order = event[:order]
  order.order_promotions.destroy_all
end