spree/spree — pull request #5379 by metade (2014-09-17 15:05:38+00:00)
Title: Let's not load all of the promotion codes in the admin interface

We have hundreds if not thousands of Promotions in our application.

The admin interface (orders index page) is currently loading all promotions (i.e. `Spree::Promotion.all.collect {|p| [p.name, p.id]}`) to display a drop down of all promotions.

This is slow.

This PR will only load promotion codes that have been applied to an order, and use pluck rather than collect to load the promotion name and id.