Skip to content

Commit 6708e84

Browse files
committed
Merge pull request rails#4349 from lest/change-array-wrap-2
Array.wrap is an overhead as there is already check for class
2 parents 69fe594 + 517b8fb commit 6708e84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/nested_attributes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def assign_nested_attributes_for_collection_association(association_name, attrib
382382
if attributes_collection.is_a? Hash
383383
keys = attributes_collection.keys
384384
attributes_collection = if keys.include?('id') || keys.include?(:id)
385-
Array.wrap(attributes_collection)
385+
[attributes_collection]
386386
else
387387
attributes_collection.values
388388
end

0 commit comments

Comments
 (0)