aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapter_test.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2016-12-14 11:47:51 +0100
committerJean Boussier <jean.boussier@gmail.com>2016-12-14 14:25:43 +0100
commit11e05defecde965e0eb1929f1b0f1f992be39a6b (patch)
tree2743c8f2f18edf9aaf4bea170805fe080e216d89 /activerecord/test/cases/adapter_test.rb
parente3e663f1dc40a5cfae9ec60e32f5372cd7f9885b (diff)
downloadrails-11e05defecde965e0eb1929f1b0f1f992be39a6b.tar.gz
rails-11e05defecde965e0eb1929f1b0f1f992be39a6b.tar.bz2
rails-11e05defecde965e0eb1929f1b0f1f992be39a6b.zip
Fix constantize edge case involving prepend, autoloading and name conflicts
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.
Diffstat (limited to 'activerecord/test/cases/adapter_test.rb')
0 files changed, 0 insertions, 0 deletions