Class: Spree::PromotionAction
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::PromotionAction
- Defined in:
- app/models/spree/promotion_action.rb
Direct Known Subclasses
Spree::Promotion::Actions::CreateAdjustment, Spree::Promotion::Actions::CreateLineItems
Instance Method Summary collapse
- #credit_exists_on_order?(order) ⇒ Boolean
-
#perform(options = {}) ⇒ Object
This method should be overriden in subclass Updates the state of the order or performs some other action depending on the subclass options will contain the payload from the event that activated the promotion.
Instance Method Details
#credit_exists_on_order?(order) ⇒ Boolean
17 18 19 |
# File 'app/models/spree/promotion_action.rb', line 17 def credit_exists_on_order?(order) !!order.promotion_credit_exists?(self) end |
#perform(options = {}) ⇒ Object
This method should be overriden in subclass Updates the state of the order or performs some other action depending on the subclass options will contain the payload from the event that activated the promotion. This will include the key :user which allows user based actions to be performed in addition to actions on the order
13 14 15 |
# File 'app/models/spree/promotion_action.rb', line 13 def perform( = {}) raise 'perform should be implemented in a sub-class of PromotionAction' end |