From 22e47279bc5a905b2535b9bbf7061ca72e8d3b71 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 20 Jul 2011 15:52:53 -0700 Subject: no need to sort the values --- activerecord/lib/active_record/nested_attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 69a8518ba0..2dbebfcaf8 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -383,7 +383,7 @@ module ActiveRecord attributes_collection = if keys.include?('id') || keys.include?(:id) Array.wrap(attributes_collection) else - attributes_collection.sort_by { |i, _| i.respond_to?(:to_i) ? i.to_i : i.object_id }.map { |_, attributes| attributes } + attributes_collection.values end end -- cgit v1.2.3