diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 12:28:41 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 12:36:59 -0700 |
commit | 5651e4c835a4a902c9fb7dea71be48a93e0d0eca (patch) | |
tree | 8b1df058fec5fdbec92094b030f242c1b27409d7 /activerecord | |
parent | c49144b2f7b2cb9b59ea3a9cddd69de47f268ae6 (diff) | |
download | rails-5651e4c835a4a902c9fb7dea71be48a93e0d0eca.tar.gz rails-5651e4c835a4a902c9fb7dea71be48a93e0d0eca.tar.bz2 rails-5651e4c835a4a902c9fb7dea71be48a93e0d0eca.zip |
symbol to proc is slow, we should avoid it
Diffstat (limited to 'activerecord')
-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 |