diff options
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/forbidden_attributes_protection.rb | 4 | ||||
-rw-r--r-- | activemodel/test/cases/forbidden_attributes_protection_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/forbidden_attributes_protection.rb b/activemodel/lib/active_model/forbidden_attributes_protection.rb index 29bc47f151..a5e4c4f650 100644 --- a/activemodel/lib/active_model/forbidden_attributes_protection.rb +++ b/activemodel/lib/active_model/forbidden_attributes_protection.rb @@ -1,11 +1,11 @@ module ActiveModel - class ForbiddenAttributes < StandardError + class ForbiddenAttributesError < StandardError end module ForbiddenAttributesProtection def sanitize_for_mass_assignment(attributes, options = {}) if attributes.respond_to?(:permitted?) && !attributes.permitted? - raise ActiveModel::ForbiddenAttributes + raise ActiveModel::ForbiddenAttributesError else attributes end diff --git a/activemodel/test/cases/forbidden_attributes_protection_test.rb b/activemodel/test/cases/forbidden_attributes_protection_test.rb index fab28ced0e..f6437333b0 100644 --- a/activemodel/test/cases/forbidden_attributes_protection_test.rb +++ b/activemodel/test/cases/forbidden_attributes_protection_test.rb @@ -20,7 +20,7 @@ end class ActiveModelMassUpdateProtectionTest < ActiveSupport::TestCase test "forbidden attributes cannot be used for mass updating" do params = ProtectedParams.new({ "a" => "b" }) - assert_raises(ActiveModel::ForbiddenAttributes) do + assert_raises(ActiveModel::ForbiddenAttributesError) do Account.new.sanitize_for_mass_assignment(params) end end |