Class: SpreeCmCommissioner::Stock::PermanentInventoryItemsGenerator

Inherits:
BaseInteractor
  • Object
show all
Defined in:
app/interactors/spree_cm_commissioner/stock/permanent_inventory_items_generator.rb

Instance Method Summary collapse

Instance Method Details

#callObject



12
13
14
15
16
# File 'app/interactors/spree_cm_commissioner/stock/permanent_inventory_items_generator.rb', line 12

def call
  variants.in_batches(of: variants_per_batch) do |batch|
    generate_inventory_items_for_batch(batch)
  end
end

#pre_inventory_days_for(variant) ⇒ Object



8
9
10
# File 'app/interactors/spree_cm_commissioner/stock/permanent_inventory_items_generator.rb', line 8

def pre_inventory_days_for(variant)
  context.pre_inventory_days || variant.pre_inventory_days
end

#variants_per_batchObject



6
# File 'app/interactors/spree_cm_commissioner/stock/permanent_inventory_items_generator.rb', line 6

def variants_per_batch = 1000