Class: SpreeCmCommissioner::InventoryItems::BulkAdjustQuantitiesByVariant

Inherits:
Object
  • Object
show all
Extended by:
ServiceModuleThrowable
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree_cm_commissioner/inventory_items/bulk_adjust_quantities_by_variant.rb

Instance Method Summary collapse

Methods included from ServiceModuleThrowable

call!

Instance Method Details

#call(variant:, quantity:) ⇒ Object



7
8
9
10
11
12
13
# File 'app/services/spree_cm_commissioner/inventory_items/bulk_adjust_quantities_by_variant.rb', line 7

def call(variant:, quantity:)
  variant.inventory_items.active.find_each do |inventory_item|
    inventory_item.adjust_quantity!(quantity)
  end

  success(nil)
end