diff options
author | Xavier Noria <fxn@hashref.com> | 2019-04-23 00:36:14 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2019-04-23 01:18:21 +0200 |
commit | 1b2efe5a111941d57edbaf2be7f3a94eb02b5f9d (patch) | |
tree | 6829f4218faa04a0ac7b2cf571eb9e9281e67b1a /activesupport/lib/active_support/dependencies/zeitwerk_integration.rb | |
parent | cc834db1d0815744cfa173813c05d928e008e167 (diff) | |
download | rails-1b2efe5a111941d57edbaf2be7f3a94eb02b5f9d.tar.gz rails-1b2efe5a111941d57edbaf2be7f3a94eb02b5f9d.tar.bz2 rails-1b2efe5a111941d57edbaf2be7f3a94eb02b5f9d.zip |
upgrades Zeitwerk to 2.1.4
This commit more or less undoes 9b5401f, restores autoloaded? not to
touch the descendants tracker, and autoloaded_constants because it is
documented in the guide.
Diffstat (limited to 'activesupport/lib/active_support/dependencies/zeitwerk_integration.rb')
-rw-r--r-- | activesupport/lib/active_support/dependencies/zeitwerk_integration.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb b/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb index d5dc7c2ff4..fd39ad6e55 100644 --- a/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb +++ b/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb @@ -23,8 +23,13 @@ module ActiveSupport ActiveSupport::Inflector.safe_constantize(cpath) end - def to_unload?(cpath) - Rails.autoloaders.main.to_unload?(cpath) + def autoloaded_constants + Rails.autoloaders.main.unloadable_cpaths + end + + def autoloaded?(object) + cpath = object.is_a?(Module) ? object.name : object.to_s + Rails.autoloaders.main.unloadable_cpath?(cpath) end def verbose=(verbose) |