Sha256: 733f23e4c098d4850983f6c5e6e52da6da1a41eb13b17a1f8555220d060267a1
Contents?: true
Size: 855 Bytes
Versions: 28
Compression:
Stored size: 855 Bytes
Contents
module Spree # Base class for all types of promotion action. # # PromotionActions perform the necessary tasks when a promotion is activated # by an event and determined to be eligible. class PromotionAction < Spree::Base acts_as_paranoid belongs_to :promotion, class_name: 'Spree::Promotion' scope :of_type, ->(t) { where(type: t) } # 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 # # @note This method should be overriden in subclassses. def perform(options = {}) raise 'perform should be implemented in a sub-class of PromotionAction' end end end
Version data entries
28 entries across 28 versions & 1 rubygems