Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
pdf opened this Issue · 2 comments

2 participants

@pdf

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.

@pdf

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...

@matt-glover

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.