Class: Spree::Catalogs::Update
- Defined in:
- app/workflows/spree/catalogs/update.rb
Overview
Updates a catalog, and the price list it prices through when one rides along in the payload (docs/plans/6.0-catalog-agreement-rework.md).
Instance Method Summary collapse
-
#perform(catalog:, attributes: {}) ⇒ 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 Method Details
#perform(catalog:, attributes: {}) ⇒ Spree::ServiceModule::Result
Returns value is the catalog.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/workflows/spree/catalogs/update.rb', line 14 def perform(catalog:, attributes: {}) super step :assign_attributes run_hooks :validate ApplicationRecord.transaction do step :save_catalog step :apply_price_list step :apply_assignments step :apply_order_minimums run_hooks :after_update end success(catalog) end |