Class: Spree::PromotionCodeBatch Private
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::PromotionCodeBatch
- Defined in:
- app/models/spree/promotion_code_batch.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: CantProcessStartedBatch
Instance Method Summary collapse
- #finished? ⇒ Boolean private
- #process ⇒ Object private
Instance Method Details
#finished? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'app/models/spree/promotion_code_batch.rb', line 12 def finished? state == "completed" end |
#process ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 23 |
# File 'app/models/spree/promotion_code_batch.rb', line 16 def process if state == "pending" update!(state: "processing") PromotionCodeBatchJob.perform_later(self) else raise CantProcessStartedBatch.new("Batch #{id} already started") end end |