Class: SpreeCmCommissioner::CompletionSteps::RegenerateForLineItemsJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/spree_cm_commissioner/completion_steps/regenerate_for_line_items_job.rb

Instance Method Summary collapse

Methods included from ApplicationJobDecorator

handle_deserialization_error, prepended

Instance Method Details

#perform(options = {}) ⇒ Object

Thin wrapper that regenerates completion steps for all line items of a product when a ProductCompletionStep is changed. ApplicationJob handles error logging via around_perform hook.



7
8
9
10
11
# File 'app/jobs/spree_cm_commissioner/completion_steps/regenerate_for_line_items_job.rb', line 7

def perform(options = {})
  product = Spree::Product.find(options[:product_id])

  SpreeCmCommissioner::CompletionSteps::RegenerateForLineItems.call(product: product)
end