MountainRoseHerbs/spree — pull request #17 by mbj (2014-10-02 16:58:46+00:00)
Title: Refactor Promotion.applied scope to query faster

* Before the scope did two joins. Joining the join table and than the
orders table. As joining the join table is sufficient to define the
result set removing one layer of joins significantly speeds up the
operation on large order tables.