1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/autoloading_fixtures
Jean Boussier 11e05defec 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.
2016-12-14 14:25:43 +01:00
..
a normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
class_folder applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
html
load_path normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
module_folder normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
module_with_custom_const_missing/a normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
prepend Fix constantize edge case involving prepend, autoloading and name conflicts 2016-12-14 14:25:43 +01:00
application.rb
circular1.rb
circular2.rb
class_folder.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
conflict.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
counting_loader.rb
cross_site_dependency.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
d.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
em.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
loads_constant.rb
multiple_constant_file.rb
prepend.rb Fix constantize edge case involving prepend, autoloading and name conflicts 2016-12-14 14:25:43 +01:00
raises_arbitrary_exception.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
raises_name_error.rb
raises_no_method_error.rb
requires_constant.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
should_not_be_required.rb
throws.rb Prevent void context warnings 2016-04-03 23:47:05 +01:00
typo.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00