aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-08-13 12:28:41 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-13 12:36:59 -0700
commit5651e4c835a4a902c9fb7dea71be48a93e0d0eca (patch)
tree8b1df058fec5fdbec92094b030f242c1b27409d7 /activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
parentc49144b2f7b2cb9b59ea3a9cddd69de47f268ae6 (diff)
downloadrails-5651e4c835a4a902c9fb7dea71be48a93e0d0eca.tar.gz
rails-5651e4c835a4a902c9fb7dea71be48a93e0d0eca.tar.bz2
rails-5651e4c835a4a902c9fb7dea71be48a93e0d0eca.zip
symbol to proc is slow, we should avoid it
Diffstat (limited to 'activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb2
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