From 80c30e4b8fa099a2bc747bb28990d3aafdf4f876 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 28 Jan 2015 21:46:34 -0800 Subject: let dependencies use Module#const_defined? Module#const_defined? accepts constant paths in modern Ruby, we no longer need our qualified_* extensions. References #17845. --- activesupport/lib/active_support/dependencies.rb | 4 ++-- 1 file 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 -- cgit v1.2.3