Browse files

Array.wrap is an overhead as there is already check for class

  • Loading branch information...
1 parent fc95642 commit 517b8fb237889923f55d931d8bfbf2e07578b822 @lest lest committed Jan 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/nested_attributes.rb
View
2 activerecord/lib/active_record/nested_attributes.rb
@@ -382,7 +382,7 @@ def assign_nested_attributes_for_collection_association(association_name, attrib
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

0 comments on commit 517b8fb

Please sign in to comment.