mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
let dependencies use Module#const_defined?
Module#const_defined? accepts constant paths in modern Ruby, we no longer need our qualified_* extensions. References #17845.
This commit is contained in:
parent
74c2961bd8
commit
80c30e4b8f
1 changed files with 2 additions and 2 deletions
|
@ -373,7 +373,7 @@ module ActiveSupport #:nodoc:
|
|||
|
||||
# Is the provided constant path defined?
|
||||
def qualified_const_defined?(path)
|
||||
Object.qualified_const_defined?(path.sub(/^::/, ''), false)
|
||||
Object.const_defined?(path, false)
|
||||
end
|
||||
|
||||
# Given +path+, a filesystem path to a ruby file, return an array of
|
||||
|
@ -607,7 +607,7 @@ module ActiveSupport #:nodoc:
|
|||
def autoloaded?(desc)
|
||||
return false if desc.is_a?(Module) && desc.anonymous?
|
||||
name = to_constant_name desc
|
||||
return false unless qualified_const_defined? name
|
||||
return false unless qualified_const_defined?(name)
|
||||
return autoloaded_constants.include?(name)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue