Module: SolidusLegacyPromotions::SpreePromotionCodeBatchDecorator

Included in:
Spree::PromotionCodeBatch
Defined in:
app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb

Instance Method Summary collapse

Instance Method Details

#processObject



5
6
7
8
9
10
11
12
# File 'app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb', line 5

def process
  if state == "pending"
    update!(state: "processing")
    Spree::PromotionCodeBatchJob.perform_later(self)
  else
    raise Spree::PromotionCodeBatch::CantProcessStartedBatch.new("Batch #{id} already started")
  end
end