aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-07-13 21:59:06 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-07-13 21:59:06 +0100
commit40b387580ff251e06632fbcc87c2a78c027a6b27 (patch)
tree3c662949d5939dc7879e0841b484832e40e98951 /activerecord/lib
parent373b053dc8b99dac1abc3879a17a2bf8c30302b5 (diff)
downloadrails-40b387580ff251e06632fbcc87c2a78c027a6b27.tar.gz
rails-40b387580ff251e06632fbcc87c2a78c027a6b27.tar.bz2
rails-40b387580ff251e06632fbcc87c2a78c027a6b27.zip
Use map! instead of map for <association>_ids
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 1b884fd2ab..419967b833 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1276,9 +1276,9 @@ module ActiveRecord
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