spree/spree — pull request #3513 by huoxito (2013-08-06 17:23:45+00:00)
Title: Dont update shipments and payment in order cart

Adding a product to cart on a fresh spree install currently runs 41 SQL
queries. This change makes the POST orders/populate request run 34 SQL
queries.

So each time the store needs to run `order.update!` and the order is not
completed yet we run 7 less queries. That could make a big difference
when lots of promotions are involved.

Guys does the store really needs to care about shipment and payment state before it's not completed? I couldn't think of a use case for that. At first I added an `if order.cart?` statement to run that code but then realized we might not need that at all if the order is not completed. Build is still fine.

let me know your thoughts please