Class: Spree::CouponCodes::BulkGenerateJob

Inherits:
BaseJob
  • Object
show all
Defined in:
app/jobs/spree/coupon_codes/bulk_generate_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(promotion_id, quantity) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/jobs/spree/coupon_codes/bulk_generate_job.rb', line 6

def perform(promotion_id, quantity)
  promotion = Spree::Promotion.find(promotion_id)
  return unless promotion.present?

  Spree::CouponCodes::BulkGenerate.call(
    promotion: promotion,
    quantity: quantity
  )
end