1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove unneeded code since pluck is respecting joins now

This commit is contained in:
Rafael Mendonça França 2012-06-19 20:49:27 -03:00
parent 60ffe41980
commit 1579f128ab

View file

@ -50,18 +50,7 @@ module ActiveRecord
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