Class: Spree::PriceLists::Update
- Defined in:
- app/workflows/spree/price_lists/update.rb
Overview
Updates a price list and applies the price overrides that ride with it. Product membership is not part of this payload — it lives on the uniform nested products surface, the same protocol categories, collections and catalogs use.
Instance Method Summary collapse
-
#perform(price_list:, attributes: {}) ⇒ 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:, attributes: {}) ⇒ Spree::ServiceModule::Result
Returns value is the price list.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/workflows/spree/price_lists/update.rb', line 14 def perform(price_list:, attributes: {}) super step :assign_attributes run_hooks :validate ApplicationRecord.transaction do step :save_price_list step :apply_prices run_hooks :after_update end success(price_list) end |