Skip to content

Commit

Permalink
Legacy Promotions: Remove unneeded decorator
Browse files Browse the repository at this point in the history
This is an artifact of the piece-by-piece extraction process I believe.
Since is now done, we can remove this decorator.
  • Loading branch information
mamhoff authored and tvdeyen committed Nov 30, 2024
1 parent 68c4b1a commit 9a74fda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.

This file was deleted.

9 changes: 9 additions & 0 deletions legacy_promotions/app/models/spree/promotion_code_batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@ class CantProcessStartedBatch < StandardError
def finished?
state == "completed"
end

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

0 comments on commit 9a74fda

Please sign in to comment.