diff options
author | Xavier Noria <fxn@hashref.com> | 2015-01-28 21:46:34 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-01-28 21:47:15 -0800 |
commit | 80c30e4b8fa099a2bc747bb28990d3aafdf4f876 (patch) | |
tree | 743dcad2d24ebc7cf89329c1f77b084b64eeb058 | |
parent | 74c2961bd864f633c79c03e62c2cb142642201c5 (diff) | |
download | rails-80c30e4b8fa099a2bc747bb28990d3aafdf4f876.tar.gz rails-80c30e4b8fa099a2bc747bb28990d3aafdf4f876.tar.bz2 rails-80c30e4b8fa099a2bc747bb28990d3aafdf4f876.zip |
let dependencies use Module#const_defined?
Module#const_defined? accepts constant paths in modern Ruby, we no longer
need our qualified_* extensions.
References #17845.
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index e03e7c30d8..664cc15a29 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -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 |