Skip to content

Commit

Permalink
Array.wrap is an overhead as there is already check for class
Browse files Browse the repository at this point in the history
  • Loading branch information
lest committed Jan 6, 2012
1 parent fc95642 commit 517b8fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/nested_attributes.rb
Expand Up @@ -382,7 +382,7 @@ def assign_nested_attributes_for_collection_association(association_name, attrib
if attributes_collection.is_a? Hash if attributes_collection.is_a? Hash
keys = attributes_collection.keys keys = attributes_collection.keys
attributes_collection = if keys.include?('id') || keys.include?(:id) attributes_collection = if keys.include?('id') || keys.include?(:id)
Array.wrap(attributes_collection) [attributes_collection]
else else
attributes_collection.values attributes_collection.values
end end
Expand Down

0 comments on commit 517b8fb

Please sign in to comment.