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:
parent
60ffe41980
commit
1579f128ab
1 changed files with 1 additions and 12 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue