Class: SolidusFriendlyPromotions::PromotionCodeBatch
- Inherits:
-
Spree::Base
- Object
- Spree::Base
- SolidusFriendlyPromotions::PromotionCodeBatch
show all
- Defined in:
- app/models/solidus_friendly_promotions/promotion_code_batch.rb
Defined Under Namespace
Classes: CantProcessStartedBatch
Instance Method Summary
collapse
Instance Method Details
#finished? ⇒ Boolean
14
15
16
|
# File 'app/models/solidus_friendly_promotions/promotion_code_batch.rb', line 14
def finished?
state == "completed"
end
|
#process ⇒ Object
18
19
20
21
22
23
|
# File 'app/models/solidus_friendly_promotions/promotion_code_batch.rb', line 18
def process
raise CantProcessStartedBatch, "Batch #{id} already started" unless state == "pending"
update!(state: "processing")
PromotionCodeBatchJob.perform_later(self)
end
|