diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-12 15:15:45 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-12 15:15:45 -0800 |
commit | e1beb7d2878cb55a045731b4a4c0c7a6046b3c09 (patch) | |
tree | 37f70ef140e1f69b4cbb3572787437598b84d309 | |
parent | 8f9944d5bcd684fedbd23e4fd77a2dabfaff6fad (diff) | |
download | rails-e1beb7d2878cb55a045731b4a4c0c7a6046b3c09.tar.gz rails-e1beb7d2878cb55a045731b4a4c0c7a6046b3c09.tar.bz2 rails-e1beb7d2878cb55a045731b4a4c0c7a6046b3c09.zip |
use array maths rather than *args
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 6433cc3034..da3800bf4a 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -358,8 +358,10 @@ module ActiveRecord if i @target.delete_at(i).tap do |t| keys = ["id"] + t.changes.keys + (f.attribute_names - t.attribute_names) - f.attributes.except(*keys).each do |k,v| - t.send("#{k}=", v) + # FIXME: this call to attributes causes many NoMethodErrors + attributes = f.attributes + (attributes.keys - keys).each do |k| + t.send("#{k}=", attributes[k]) end end else |