Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '3-1-stable' of https://github.com/rails/rails.git into …

…3-1-stable
  • Loading branch information...
commit 0bf4f370dd84194b401531f7342359b6124ac5e2 2 parents 01dde6c + 9a6b96a
@jhtwong jhtwong authored
View
2  activerecord/lib/active_record/nested_attributes.rb
@@ -383,7 +383,7 @@ def assign_nested_attributes_for_collection_association(association_name, attrib
attributes_collection = if keys.include?('id') || keys.include?(:id)
Array.wrap(attributes_collection)
else
- attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }
+ attributes_collection.values
end
end
View
5 activerecord/test/cases/nested_attributes_test.rb
@@ -755,6 +755,11 @@ def test_validate_presence_of_parent_fails_without_inverse_of
Interest.reflect_on_association(:man).options[:inverse_of] = :interests
end
+ def test_can_use_symbols_as_object_identifier
+ @pirate.attributes = { :parrots_attributes => { :foo => { :name => 'Lovely Day' }, :bar => { :name => 'Blown Away' } } }
+ assert_nothing_raised(NoMethodError) { @pirate.save! }
+ end
+
private
def association_setter
Please sign in to comment.
Something went wrong with that request. Please try again.