mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use real_mod_name on check for removed module
Previously this check could break if `name` was overridden on the module we were checking.
This commit is contained in:
parent
9055156668
commit
15874514fa
1 changed files with 2 additions and 1 deletions
|
@ -533,7 +533,8 @@ module ActiveSupport #:nodoc:
|
||||||
# it is not possible to load the constant into from_mod, try its parent
|
# it is not possible to load the constant into from_mod, try its parent
|
||||||
# module using +const_missing+.
|
# module using +const_missing+.
|
||||||
def load_missing_constant(from_mod, const_name)
|
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!"
|
raise ArgumentError, "A copy of #{from_mod} has been removed from the module tree but is still active!"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue