Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix constantize edge case involving prepend, autoloading and name conflicts | Jean Boussier | 2016-12-14 | 1 | -0/+8 |
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. |