Skip to content
Permalink
Browse files

Revert "Optimize Spree::InventoryUnit#quantity_no_less_than_shipped"

This reverts commit df0740c.

Conflicts:

	core/app/models/spree/line_item.rb
  • Loading branch information...
radar committed Aug 28, 2012
1 parent e1c6f0e commit d7f386cf9663e907905d2c7daffa22ccf2cde358
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/app/models/spree/line_item.rb
@@ -97,7 +97,7 @@ def stock_availability
end

def quantity_no_less_than_shipped
already_shipped = order.shipments.reduce(0) { |acc,s| acc + s.inventory_units.where(:variant_id => variant.id).count }
already_shipped = order.shipments.reduce(0) { |acc,s| acc + s.inventory_units.select { |i| i.variant == variant }.count }
unless quantity >= already_shipped
errors.add(:quantity, I18n.t('validation.cannot_be_less_than_shipped_units'))
end

0 comments on commit d7f386c

Please sign in to comment.
You can’t perform that action at this time.