Sha256: 7d116ae3637f3dfc29a5792bad4df8487bd0a3e116996398cc7b6326802d2932

Contents?: true

Size: 288 Bytes

Versions: 11

Compression:

Stored size: 288 Bytes

Contents

# create the inventory units associated with the line item (we need to do this after the fixture b/c quantity is random)
Spree::LineItem.all.each do |li|
  li.quantity.times { li.order.inventory_units.create(:variant => li.variant, :state => 'sold', :shipment => li.order.shipment) }
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_sample-1.0.7 db/sample/spree/inventory_units.rb
spree_sample-1.0.6 db/sample/spree/inventory_units.rb
spree_sample-1.0.4 db/sample/spree/inventory_units.rb
spree_sample-1.0.3 db/sample/spree/inventory_units.rb
spree_sample-1.0.2 db/sample/spree/inventory_units.rb
spree_sample-1.0.1 db/sample/spree/inventory_units.rb
spree_sample-1.0.0 db/sample/spree/inventory_units.rb
spree_sample-1.0.0.rc4 db/sample/spree/inventory_units.rb
spree_sample-1.0.0.rc3 db/sample/spree/inventory_units.rb
spree_sample-1.0.0.rc2 db/sample/spree/inventory_units.rb
spree_sample-1.0.0.rc1 db/sample/spree/inventory_units.rb