1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #40160 from jhawthorn/fix_classic_autoloader

Use real_mod_name on check for removed module in classic autoloader
This commit is contained in:
John Hawthorn 2020-09-02 15:41:28 -07:00 committed by GitHub
commit fbaf50f5f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -533,7 +533,8 @@ module ActiveSupport #:nodoc:
# it is not possible to load the constant into from_mod, try its parent
# module using +const_missing+.
def load_missing_constant(from_mod, const_name)
unless qualified_const_defined?(from_mod.name) && Inflector.constantize(from_mod.name).equal?(from_mod)
from_mod_name = real_mod_name(from_mod)
unless qualified_const_defined?(from_mod_name) && Inflector.constantize(from_mod_name).equal?(from_mod)
raise ArgumentError, "A copy of #{from_mod} has been removed from the module tree but is still active!"
end