Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Calling respond_to? when loading collection through association causes full load of associated records #729

pdf opened this Issue · 2 comments

2 participants


In ActiveRecord::Associations::CollectionProxy, a call to respond_to? triggers load_target before checking the proxy_association class, which in turn calls .all on the association, forcing immediate load of all records. In my application this is causing the early load of millions of records, since scopes have not yet been applied.


Attached is a suggestion for fixing this on AR, for master and 2.0 branches. No specs included, not sure how best to go about testing it...


See also #398 and linked issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.