aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/dependencies.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index ad4e4da669..b169393bf7 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -405,8 +405,9 @@ protected
def remove_constant(const)
return false unless qualified_const_defined? const
+ const = $1 if /\A::(.*)\Z/ =~ const.to_s
names = const.split('::')
- if names.size == 1 || names.first.empty? # It's under Object
+ if names.size == 1 # It's under Object
parent = Object
else
parent = (names[0..-2] * '::').constantize