From 517b8fb237889923f55d931d8bfbf2e07578b822 Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Fri, 6 Jan 2012 17:02:17 +0300 Subject: Array.wrap is an overhead as there is already check for class --- activerecord/lib/active_record/nested_attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3