rails/rails — pull request #9252 by senny (2013-02-11 20:40:58+00:00)
Title: don't cache invalid subsets when preloading hmt associations

this fixes #8423. The problematic area, was that the through_association-preloader eager-loaded the `has_many` association even when the there were additional conditions on the hmt association. This resulted that a subset of the `has_many` association was cached.

After the patch AR only caches the `has_many` association when there are no additional conditions on the `has_many :through` association.

If possible I'd like to submit a backport to `3-2-stable`.