spree/spree — pull request #5647 by metade (2014-11-20 09:16:04+00:00)
Title: Optimise cart link

Here's a couple of tweaks to optimise cart_link:

* in `Spree::Core::ControllerHelpers::Order#find_order_by_token_or_user` ensures that the `option[:lock]` defaults to false for both `simple_current_order` and `current_order`
* in `Spree::Core::ControllerHelpers::Order#simple_current_order` if the order isn't found, return a new empty order that is then memoized instead of returning nil - this avoids hitting the DB twice

The really big optimisation we found though was to index the `spree_orders.guest_token` column - is it appropriate to add this to this PR?