diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-19 20:49:27 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-19 21:01:27 -0300 |
commit | 1579f128ab28e36bbf8e91872857472e7c705720 (patch) | |
tree | 465ab506408e7ff77ee62a8b85dfc138594c1eeb /activerecord/lib/active_record/associations | |
parent | 60ffe41980f3989637bdf537341288288aa9cc39 (diff) | |
download | rails-1579f128ab28e36bbf8e91872857472e7c705720.tar.gz rails-1579f128ab28e36bbf8e91872857472e7c705720.tar.bz2 rails-1579f128ab28e36bbf8e91872857472e7c705720.zip |
Remove unneeded code since pluck is respecting joins now
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index e94fe35170..2447914640 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -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 |