aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-01-06 12:48:13 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2012-01-06 12:48:13 -0800
commit6708e8438cf250afe102d131fdc1f08302427295 (patch)
tree7d146ba1ed0786118a18c5f8139687632d6e5eea /activerecord/lib
parent69fe594e692d5bf58276cb07f318c031c2789e5e (diff)
parent517b8fb237889923f55d931d8bfbf2e07578b822 (diff)
downloadrails-6708e8438cf250afe102d131fdc1f08302427295.tar.gz
rails-6708e8438cf250afe102d131fdc1f08302427295.tar.bz2
rails-6708e8438cf250afe102d131fdc1f08302427295.zip
Merge pull request #4349 from lest/change-array-wrap-2
Array.wrap is an overhead as there is already check for class
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index a8ee43b598..9e21039c4f 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -382,7 +382,7 @@ module ActiveRecord
if attributes_collection.is_a? Hash
keys = attributes_collection.keys
attributes_collection = if keys.include?('id') || keys.include?(:id)
- Array.wrap(attributes_collection)
+ [attributes_collection]
else
attributes_collection.values
end