This project is archived and is in readonly mode.

#2975 ✓wontfix
Rajesh

constantize now less robust in 2.3.3

Reported by Rajesh | July 30th, 2009 @ 07:50 PM

Constantize cannot access internal classes declared in super classes in 2.3.3 but seems to be working fine in 2.1.0

class A
 class B
 end 
end

class C < A
end

In 2.3.3 console:

C::B => A::B

'C::B'.constantize NameError: uninitialized constant C::B

from /Users/tim/src/property/rails23/vendor/rails/activesupport/lib/active_support/dependencies.rb:105:in `const_missing'
from /Users/tim/src/property/rails23/vendor/rails/activesupport/lib/active_support/inflector.rb:361:in `constantize'
from /Users/tim/src/property/rails23/vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `each'
from /Users/tim/src/property/rails23/vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `constantize'
from /Users/tim/src/property/rails23/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
from (irb):4

But it works fine in 2.1.0:

'C::B'.constantize => A::B

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages