aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-12 15:15:45 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-12 15:15:45 -0800
commite1beb7d2878cb55a045731b4a4c0c7a6046b3c09 (patch)
tree37f70ef140e1f69b4cbb3572787437598b84d309 /activerecord
parent8f9944d5bcd684fedbd23e4fd77a2dabfaff6fad (diff)
downloadrails-e1beb7d2878cb55a045731b4a4c0c7a6046b3c09.tar.gz
rails-e1beb7d2878cb55a045731b4a4c0c7a6046b3c09.tar.bz2
rails-e1beb7d2878cb55a045731b4a4c0c7a6046b3c09.zip
use array maths rather than *args
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb6
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