Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6927 from parndt/patch-3

Make ArgumentError message more consistent in nested attributes
  • Loading branch information...
commit 8ce61a366474b20368f60eb1c7bf31c3b7297873 2 parents a5efd58 + a1ad02a
Carlos Antonio da Silva carlosantoniodasilva authored
4 activerecord/lib/active_record/nested_attributes.rb
View
@@ -351,7 +351,7 @@ def assign_nested_attributes_for_one_to_one_association(association_name, attrib
if respond_to?(method)
send(method, attributes.except(*unassignable_keys(assignment_opts)), assignment_opts)
else
- raise ArgumentError, "Cannot build association #{association_name}. Are you trying to build a polymorphic one-to-one association?"
+ raise ArgumentError, "Cannot build association `#{association_name}'. Are you trying to build a polymorphic one-to-one association?"
end
end
end
@@ -373,7 +373,7 @@ def assign_nested_attributes_for_one_to_one_association(association_name, attrib
# })
#
# Will update the name of the Person with ID 1, build a new associated
- # person with the name `John', and mark the associated Person with ID 2
+ # person with the name 'John', and mark the associated Person with ID 2
# for destruction.
#
# Also accepts an Array of attribute hashes:
2  activerecord/test/cases/nested_attributes_test.rb
View
@@ -196,7 +196,7 @@ def setup
end
def test_should_raise_argument_error_if_trying_to_build_polymorphic_belongs_to
- assert_raise_with_message ArgumentError, "Cannot build association looter. Are you trying to build a polymorphic one-to-one association?" do
+ assert_raise_with_message ArgumentError, "Cannot build association `looter'. Are you trying to build a polymorphic one-to-one association?" do
Treasure.new(:name => 'pearl', :looter_attributes => {:catchphrase => "Arrr"})
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.