Skip to content

Commit

Permalink
Remove deprecated constant `AbstractController::Helpers::MissingHelpe…
Browse files Browse the repository at this point in the history
…rError`
  • Loading branch information
rafaelfranca committed Nov 22, 2023
1 parent b2f96d0 commit 87bc119
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
4 changes: 4 additions & 0 deletions actionpack/CHANGELOG.md
@@ -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

Expand Down
18 changes: 0 additions & 18 deletions actionpack/lib/abstract_controller/helpers.rb
Expand Up @@ -5,7 +5,6 @@

module AbstractController
module Helpers
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
extend ActiveSupport::Concern

included do
Expand All @@ -24,23 +23,6 @@ module Helpers
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
Expand Down
6 changes: 0 additions & 6 deletions actionpack/test/controller/helper_test.rb
Expand Up @@ -264,12 +264,6 @@ def test_helper_proxy_config
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
Expand Down
2 changes: 2 additions & 0 deletions guides/source/7_2_release_notes.md
Expand Up @@ -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
Expand Down

0 comments on commit 87bc119

Please sign in to comment.