spree/spree — pull request #5774 by mtomov (2014-12-13 23:37:04+00:00)
Title: Remove n+1 lookup values on stock item exist SQL call

Fixes:

```sql
Spree::StockItem Exists (4.7ms) SELECT 1 AS one FROM "spree_stock_items" WHERE
"spree_stock_items"."deleted_at" IS NULL AND "spree_stock_items"."stock_location_id" = $1 AND
"spree_stock_items"."variant_id" IN (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, ....
```