Sha256: b3ab4cc4dbcb1952b68170223aad84f044280c1135bcb28bcfb3ad725cbc75d0
Contents?: true
Size: 725 Bytes
Versions: 14
Compression:
Stored size: 725 Bytes
Contents
# # This class manages all the things we need to do after a sale is made # # TODO: Add sending email. # class OrderProcessor < Struct.new(:order, :skip_actions) include ActionView::Helpers::TextHelper QUEUE = "order" def self.process(order, skip_actions = false) job = OrderProcessor.new(order, skip_actions) Delayed::Job.enqueue job, :queue => QUEUE end def perform self.order.create_donation_actions unless self.skip_actions self.order.create_purchase_action unless self.skip_actions process_memberships end def process_memberships self.order.memberships.each do |membership_item| Member.for(membership_item.product) end self.order.create_membership_action end end
Version data entries
14 entries across 14 versions & 1 rubygems