Skip to content
Browse files

Use map! instead of map for <association>_ids

  • Loading branch information...
1 parent 373b053 commit 40b387580ff251e06632fbcc87c2a78c027a6b27 @lifo lifo committed Jul 13, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/associations.rb
View
4 activerecord/lib/active_record/associations.rb
@@ -1276,9 +1276,9 @@ 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).all(:select => "DISTINCT #{through.quoted_table_name}.#{primary_key}").map(&:"#{primary_key}")
+ send(through.name).all(:select => "DISTINCT #{through.quoted_table_name}.#{primary_key}").map!(&:"#{primary_key}")
else
- send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map(&:id)
+ send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map!(&:id)
end
end
end

0 comments on commit 40b3875

Please sign in to comment.
Something went wrong with that request. Please try again.