Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made ArgumentError messages consistent.

  • Loading branch information...
commit a1ad02a4af213abfcd7c6602e6f2d281530c47cc 1 parent 83302a4
@parndt parndt authored
View
4 activerecord/lib/active_record/nested_attributes.rb
@@ -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:
View
2  activerecord/test/cases/nested_attributes_test.rb
@@ -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.