diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 12:28:41 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-14 13:17:30 +0200 |
commit | 5baf75b650aafc3cada246e2e0308684cc8461ca (patch) | |
tree | 02984f01ce1da6fe609d03bb69d05d11573a77e2 /activerecord/lib/active_record/associations | |
parent | 17a6dfb745d98fcecc3a2af740fee8d7ef27a019 (diff) | |
download | rails-5baf75b650aafc3cada246e2e0308684cc8461ca.tar.gz rails-5baf75b650aafc3cada246e2e0308684cc8461ca.tar.bz2 rails-5baf75b650aafc3cada246e2e0308684cc8461ca.zip |
symbol to proc is slow, we should avoid it
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index bec123e7a2..2838528a0c 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -79,7 +79,7 @@ module ActiveRecord else relation = Arel::Table.new(@reflection.options[:join_table]) relation.where(relation[@reflection.primary_key_name].eq(@owner.id). - and(Arel::Predicates::In.new(relation[@reflection.association_foreign_key], records.map(&:id))) + and(Arel::Predicates::In.new(relation[@reflection.association_foreign_key], records.map { |x| x.id })) ).delete end end |