未验证 提交 f9a0ae63 编写于 作者: E Eileen M. Uchitelle 提交者: GitHub

Merge pull request #36395 from cpruitt/6-0-stable

Do not clear deprecated initializer dependencies if using classic autoloader
......@@ -39,8 +39,14 @@ module Finisher
example = autoloaded.first
example_klass = example.constantize.class
ActiveSupport::DescendantsTracker.clear
ActiveSupport::Dependencies.clear
if config.autoloader == :zeitwerk
ActiveSupport::DescendantsTracker.clear
ActiveSupport::Dependencies.clear
unload_message = "#{these} autoloaded #{constants} #{have} been unloaded."
else
unload_message = "`config.autoloader` is set to `#{config.autoloader}`. #{these} autoloaded #{constants} would have been unloaded if `config.autoloader` had been set to `:zeitwerk`."
end
ActiveSupport::Deprecation.warn(<<~WARNING)
Initialization autoloaded the #{constants} #{enum}.
......@@ -52,7 +58,7 @@ module Finisher
initialization does not run again. So, if you reload #{example}, for example,
the expected changes won't be reflected in that stale #{example_klass} object.
#{these} autoloaded #{constants} #{have} been unloaded.
#{unload_message}
Please, check the "Autoloading and Reloading Constants" guide for solutions.
WARNING
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册