Remove deprecated constant `AbstractController::Helpers::MissingHelperError`

This commit is contained in:
Rafael Mendonça França 2023-10-12 17:32:26 +00:00
parent b2f96d07d4
commit 87bc1190fb
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
4 changed files with 6 additions and 24 deletions

View File

@ -1,3 +1,7 @@
* Remove deprecated constant `AbstractController::Helpers::MissingHelperError`.
*Rafael Mendonça França*
* Fix a race condition that could cause a `Text file busy - chromedriver`
error with parallel system tests

View File

@ -5,7 +5,6 @@ require "active_support/core_ext/name_error"
module AbstractController
module Helpers
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
extend ActiveSupport::Concern
included do
@ -24,23 +23,6 @@ module AbstractController
self._helpers = define_helpers_module(self)
end
class DeprecatedMissingHelperError < LoadError
def initialize(error, path)
@error = error
@path = "helpers/#{path}.rb"
set_backtrace error.backtrace
if /^#{path}(\.rb)?$/.match?(error.path)
super("Missing helper file helpers/%s.rb" % path)
else
raise error
end
end
end
deprecate_constant "MissingHelperError", "AbstractController::Helpers::DeprecatedMissingHelperError",
message: "AbstractController::Helpers::MissingHelperError has been deprecated. If a Helper is not present, a NameError will be raised instead.",
deprecator: AbstractController.deprecator
def _helpers
self.class._helpers
end

View File

@ -264,12 +264,6 @@ class HelperTest < ActiveSupport::TestCase
assert_equal "smth", AllHelpersController.helpers.config.my_var
end
def test_missing_helper_error_is_deprecated
assert_deprecated(AbstractController.deprecator) do
AbstractController::Helpers::MissingHelperError
end
end
private
def expected_helper_methods
TestHelper.instance_methods

View File

@ -52,6 +52,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
* Remove deprecated constant `ActionDispatch::IllegalStateError`.
* Remove deprecated constant `AbstractController::Helpers::MissingHelperError`.
### Deprecations
### Notable changes