Sha256: db4b79b3682308490a496cd59331acc0935392977e28fe146112e8860fd1fdcc
Contents?: true
Size: 484 Bytes
Versions: 13
Compression:
Stored size: 484 Bytes
Contents
module Spree module Stock class InventoryUnitBuilder def initialize(order) @order = order end def units @order.line_items.flat_map do |line_item| line_item.quantity.times.map do |i| @order.inventory_units.build( pending: true, variant_id: line_item.variant_id, line_item: line_item, order: @order ) end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems