mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
11e05defec
In the following situation: ```ruby class Bar end module Baz end class Foo prepend Baz end class Foo::Bar end ``` Running `Inflector.constantize('Foo::Bar')` would blow up with a NameError. What is happening is that `constatize` was written before the introduction of prepend, and wrongly assume that `klass.ancestors.first == klass`. So it uses `klass.ancestors.inject` without arguments, as a result a prepended module is used in place of the actual class. |
||
---|---|---|
.. | ||
a | ||
class_folder | ||
html | ||
load_path | ||
module_folder | ||
module_with_custom_const_missing/a | ||
prepend | ||
application.rb | ||
circular1.rb | ||
circular2.rb | ||
class_folder.rb | ||
conflict.rb | ||
counting_loader.rb | ||
cross_site_dependency.rb | ||
d.rb | ||
em.rb | ||
loads_constant.rb | ||
multiple_constant_file.rb | ||
prepend.rb | ||
raises_arbitrary_exception.rb | ||
raises_name_error.rb | ||
raises_no_method_error.rb | ||
requires_constant.rb | ||
should_not_be_required.rb | ||
throws.rb | ||
typo.rb |