Delete AS::Dependencies.unhook!

This commit is contained in:
Xavier Noria 2021-08-09 16:06:28 +02:00
parent 2a22b4c53b
commit bbe74a8c97
5 changed files with 0 additions and 26 deletions

View File

@ -34,8 +34,6 @@ end
ActionViewTestSuiteUtils.require_helpers("#{__dir__}/fixtures/helpers")
ActionViewTestSuiteUtils.require_helpers("#{__dir__}/fixtures/alternate_helpers")
ActiveSupport::Dependencies.hook!
Thread.abort_on_exception = true
# Show backtraces for deprecated behavior for quicker cleanup.

View File

@ -293,11 +293,6 @@ module ActiveSupport # :nodoc:
end
end
def unhook!
ModuleConstMissing.exclude_from(Module)
Loadable.exclude_from(Object)
end
def load?
mechanism == :load
end

View File

@ -37,10 +37,6 @@ module ActiveSupport
l = verbose ? logger || Rails.logger : nil
Rails.autoloaders.each { |autoloader| autoloader.logger = l }
end
def unhook!
:no_op
end
end
module Inflector
@ -103,7 +99,6 @@ module ActiveSupport
end
def decorate_dependencies
Dependencies.unhook!
Dependencies.singleton_class.prepend(Decorations)
end
end

View File

@ -245,13 +245,6 @@ module Rails
end
end
end
# Disable dependency loading during request cycle
initializer :disable_dependency_loading do
if config.eager_load && config.cache_classes && !config.enable_dependency_loading
ActiveSupport::Dependencies.unhook!
end
end
end
end
end

View File

@ -305,13 +305,6 @@ class ZeitwerkIntegrationTest < ActiveSupport::TestCase
assert_equal %i(main_autoloader), $zeitwerk_integration_reload_test
end
test "unhooks" do
boot
assert_equal Module, Module.method(:const_missing).owner
assert_equal :no_op, deps.unhook!
end
test "reloading invokes before_remove_const" do
$before_remove_const_invoked = false