Class: Spree::Catalogs::SetPriceList
- Defined in:
- app/workflows/spree/catalogs/set_price_list.rb
Overview
Writes the price list a catalog prices through, from an inline payload: creates the owned list, updates the one already owned, or removes it with nil (docs/plans/6.0-catalog-agreement-rework.md).
Removal happens only on an explicit price_list: null, never as a side
effect of omitting the key.
Instance Attribute Summary collapse
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
Instance Method Summary collapse
-
#perform(catalog:, attributes: nil) ⇒ Spree::ServiceModule::Result
Value is the catalog.
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 Attribute Details
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
10 11 12 |
# File 'app/workflows/spree/catalogs/set_price_list.rb', line 10 def catalog @catalog end |
Instance Method Details
#perform(catalog:, attributes: nil) ⇒ Spree::ServiceModule::Result
Returns value is the catalog.
15 16 17 18 19 20 21 |
# File 'app/workflows/spree/catalogs/set_price_list.rb', line 15 def perform(catalog:, attributes: nil) super step :write_price_list success(catalog) end |