Skip to content

Commit

Permalink
Do not assign order_id on inventory units in specs
Browse files Browse the repository at this point in the history
order_id column has been removed from solidus since solidusio/solidus#2377.
Now the order reference will be taken from the shipment in which the
inventory units are included.
  • Loading branch information
kennyadsl committed May 3, 2018
1 parent f0019e5 commit 0937cc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/solidus_expedited_exchanges/unreturned_item_charger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def add_exchange_variants_to_order
@return_items.group_by(&:exchange_variant).map do |variant, variant_return_items|
variant_inventory_units = variant_return_items.map(&:exchange_inventory_unit)
line_item = Spree::LineItem.create!(variant: variant, quantity: variant_return_items.count, order: new_order)
variant_inventory_units.each { |i| i.update_attributes!(line_item_id: line_item.id, order_id: new_order.id) }
variant_inventory_units.each { |i| i.update_attributes!(line_item_id: line_item.id) }
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/exchanges.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace :exchanges do

# Determine that a return item has already been deemed unreturned and therefore charged
# by the fact that its exchange inventory unit has popped off to a different order
unreturned_return_items.select! { |ri| ri.inventory_unit.order_id == ri.exchange_inventory_unit.order_id }
unreturned_return_items.select! { |ri| ri.inventory_unit.order.id == ri.exchange_inventory_unit.order.id }

failures = []

Expand Down

0 comments on commit 0937cc6

Please sign in to comment.