Sha256: 0c02ab5c084a53dbb21d2108ce3f81e905d7006b0282fae14e1e5489d6d20ac7
Contents?: true
Size: 567 Bytes
Versions: 98
Compression:
Stored size: 567 Bytes
Contents
module Spree module Stock class InventoryUnitBuilder def initialize(order) @order = order end def units @order.line_items.map do |line_item| # They go through multiple splits, avoid loading the # association to order until needed. Spree::InventoryUnit.new( pending: true, line_item_id: line_item.id, variant_id: line_item.variant_id, quantity: line_item.quantity, order_id: @order.id ) end end end end end
Version data entries
98 entries across 98 versions & 1 rubygems