Skip to content

Commit

Permalink
converting to a symbol is not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove authored and fxn committed Aug 14, 2010
1 parent 6a14eee commit 22b9bbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/associations.rb
Expand Up @@ -1505,7 +1505,7 @@ def collection_reader_method(reflection, association_proxy_class)
if reflection.through_reflection && reflection.source_reflection.belongs_to?
through = reflection.through_reflection
primary_key = reflection.source_reflection.primary_key_name
send(through.name).select("DISTINCT #{through.quoted_table_name}.#{primary_key}").map! { |r| r.send(:"#{primary_key}") }
send(through.name).select("DISTINCT #{through.quoted_table_name}.#{primary_key}").map! { |r| r.send(primary_key) }
else
send(reflection.name).select("#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").except(:includes).map! { |r| r.id }
end
Expand Down

0 comments on commit 22b9bbc

Please sign in to comment.