aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/autoloading_fixtures/prepend.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix constantize edge case involving prepend, autoloading and name conflictsJean Boussier2016-12-141-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.