aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-01-06 17:02:17 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-01-06 17:02:17 +0300
commit517b8fb237889923f55d931d8bfbf2e07578b822 (patch)
treee3fefbc07972654624b9d549d28528ba867a99e2 /activerecord/lib/active_record
parentfc956425d405e75bcf310f3e6f08cf201cc8131a (diff)
downloadrails-517b8fb237889923f55d931d8bfbf2e07578b822.tar.gz
rails-517b8fb237889923f55d931d8bfbf2e07578b822.tar.bz2
rails-517b8fb237889923f55d931d8bfbf2e07578b822.zip
Array.wrap is an overhead as there is already check for class
Diffstat (limited to 'activerecord/lib/active_record')
-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