From 6a485c3100090fbf474336802c851b842b8a96f3 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sat, 9 Dec 2006 05:21:33 +0000 Subject: Fix remove_constant to correctly handle constant names of the form "::A::...". References #6720. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5710 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/dependencies.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3