bypass preloading for ids_reader #4014

Merged
merged 1 commit into from Dec 18, 2011

Conversation

Projects
None yet
3 participants
@lest
Contributor

lest commented Dec 17, 2011

when fetching ids for a collection, bypass preloading
to avoid the unnecessary performance overhead

original issue #3870

/cc @jonleighton

@tenderlove

View changes

activerecord/lib/active_record/associations/collection_association.rb
+ join_dependency = ActiveRecord::Associations::JoinDependency.new(reflection.klass, including, [])
+ join_dependency.join_associations.each do |association|
+ relation = association.join_relation(relation)
+ end

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Dec 18, 2011

Member

could probably change this to:

relation = join_dependency.join_associations.inject(relation) do |r, association|
  association.join_relation(r)
end
@tenderlove

tenderlove Dec 18, 2011

Member

could probably change this to:

relation = join_dependency.join_associations.inject(relation) do |r, association|
  association.join_relation(r)
end

This comment has been minimized.

Show comment Hide comment
@lest

lest Dec 18, 2011

Contributor

thanks, changed

@lest

lest Dec 18, 2011

Contributor

thanks, changed

bypass preloading for ids_reader
when fetching ids for a collection, bypass preloading
to avoid the unnecessary performance overhead

jonleighton added a commit that referenced this pull request Dec 18, 2011

@jonleighton jonleighton merged commit de2306f into rails:master Dec 18, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment