Class: Spree::PriceLists::Deactivate
- Defined in:
- app/workflows/spree/price_lists/deactivate.rb
Overview
Takes a price list out of effect. Its prices stop applying immediately; nothing about them is discarded, so it can be activated again later.
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.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/workflows/spree/price_lists/deactivate.rb', line 10 def perform(price_list:) super run_hooks :validate ApplicationRecord.transaction do step :mark_inactive run_hooks :after_deactivate end success(price_list) end |