From 95c2fc967987e5dffa89a32c81bca736c7ba964d Mon Sep 17 00:00:00 2001 From: Robin Dupret Date: Wed, 25 Feb 2015 15:14:43 +0100 Subject: Follow-up to #10776 The name `ActiveModel::AttributeAssignment::UnknownAttributeError` is too implementation specific so let's move the constant directly under the ActiveModel namespace. Also since this constant used to be under the ActiveRecord namespace, to make the upgrade path easier, let's avoid raising the former constant when we deal with this error on the Active Record side. --- activemodel/test/cases/attribute_assignment_test.rb | 4 ++-- activemodel/test/cases/model_test.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'activemodel/test/cases') diff --git a/activemodel/test/cases/attribute_assignment_test.rb b/activemodel/test/cases/attribute_assignment_test.rb index 402caf21f7..64a85e01eb 100644 --- a/activemodel/test/cases/attribute_assignment_test.rb +++ b/activemodel/test/cases/attribute_assignment_test.rb @@ -49,7 +49,7 @@ class AttributeAssignmentTest < ActiveModel::TestCase test "assign non-existing attribute" do model = Model.new - error = assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) do + error = assert_raises(ActiveModel::UnknownAttributeError) do model.assign_attributes(hz: 1) end @@ -59,7 +59,7 @@ class AttributeAssignmentTest < ActiveModel::TestCase test "assign private attribute" do model = Model.new - assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) do + assert_raises(ActiveModel::UnknownAttributeError) do model.assign_attributes(metadata: { a: 1 }) end end diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb index 9a8d873ec9..3017f3541b 100644 --- a/activemodel/test/cases/model_test.rb +++ b/activemodel/test/cases/model_test.rb @@ -70,7 +70,7 @@ class ModelTest < ActiveModel::TestCase end def test_mixin_initializer_when_args_dont_exist - assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) do + assert_raises(ActiveModel::UnknownAttributeError) do SimpleModel.new(hello: 'world') end end -- cgit v1.2.3