Permalink
Browse files

Remove unneeded code since pluck is respecting joins now

  • Loading branch information...
1 parent 3243269 commit 5a7b424ea91e81e3c87634c3d72b9b1512b81ca4 @rafaelfranca committed Jun 19, 2012
Showing with 1 addition and 12 deletions.
  1. +1 −12 activerecord/lib/active_record/associations/collection_association.rb
@@ -50,18 +50,7 @@ def ids_reader
end
else
column = "#{reflection.quoted_table_name}.#{reflection.association_primary_key}"
- relation = scoped
-
- including = (relation.eager_load_values + relation.includes_values).uniq
-
- if including.any?
- join_dependency = ActiveRecord::Associations::JoinDependency.new(reflection.klass, including, [])
- relation = join_dependency.join_associations.inject(relation) do |r, association|
- association.join_relation(r)
- end
- end
-
- relation.pluck(column)
+ scoped.pluck(column)
end
end

0 comments on commit 5a7b424

Please sign in to comment.