spree/spree — pull request #692 by alexdowad (2011-10-08 14:17:32+00:00)
Title: My first PR for Spree, please give some feedback

In this thread, BDQ suggested some extra validation should be added to LineItem:

http://groups.google.com/group/spree-user/browse_thread/thread/2c008bc885dcf19/b702ba30e0a4cd9e

Validating that quantity is positive is no longer necessary, because every time a LineItem is saved, "adjust_quantity" changes negative quantities to 0.

Order no longer has "shipped_items", so I had to retrieve the shipments from order, then retrieve the inventory items from each shipment to find the number of already shipped units. I hope this doesn't degrade performance excessively.

Since this is my first PR, please let me know if there are issues with coding style or anything else.