Class: Spree::PromotionAction

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/promotion_action.rb

Instance Method Summary collapse

Methods inherited from Base

belongs_to_required_by_default, for_store, has_many_inversing, json_api_columns, json_api_permitted_attributes, json_api_type, page, spree_base_scopes, spree_base_uniqueness_scope

Methods included from Spree::Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #deprecated_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_deprecated, #preference_type, #set_preference

Instance Method Details

#perform(_options = {}) ⇒ Object

This method should be overridden 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



15
16
17
# File 'app/models/spree/promotion_action.rb', line 15

def perform(_options = {})
  raise 'perform should be implemented in a sub-class of PromotionAction'
end