spree/spree — pull request #1525 by cyu (2012-05-09 16:53:11+00:00)
Title: Account for purchased units in stock availability validation

The `LineItem#stock_availability` validation breaks admin when you try to increase/decrease the `LineItem#quantity` because the validation isn't account for units already purchased. So for example, reducing a purchased quantity from 5 to 4 when `Variant#on_hand` is 3 will result in a validation error, as well as increasing quantity on a purchased line item from 4 to 5 (buying one additional unit) under the same scenario.