Class: Spree::PriceLists::Activate
- Defined in:
- app/workflows/spree/price_lists/activate.rb
Overview
Puts a price list into effect. A list whose start date is still in the future is scheduled instead of activated, so activating is always the single answer to "make this list live" regardless of its dates.
Instance Method Summary collapse
-
#perform(price_list:) ⇒ Spree::ServiceModule::Result
Value is the price list.
Methods inherited from Workflow
#call, define_argument_readers, #errors, #halt!, hooks, inherited, model_name, #read_attribute_for_validation, #reject!, workflow_key
Methods included from ServiceModule::Base
Methods included from Workflow::ControlFlow
Instance Method Details
#perform(price_list:) ⇒ Spree::ServiceModule::Result
Returns value is the price list.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/workflows/spree/price_lists/activate.rb', line 11 def perform(price_list:) super step :require_something_to_apply_to run_hooks :validate ApplicationRecord.transaction do step :mark_live run_hooks :after_activate end success(price_list) end |