aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/constantize_test_cases.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix constantize edge case involving prepend, autoloading and name conflictsJean Boussier2016-12-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* applies new string literal convention in activesupport/testXavier Noria2016-08-061-5/+5
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #21250 from ronakjangir47/safe_constYves Senn2015-09-071-0/+4
|\ | | | | | | safe_constantize - Added Object scoped missing test cases
| * safe_constantize - Added Object scoped missing test casesRonak Jangir2015-09-061-0/+2
|/
* Use `safe_constantize`.Guo Xiang Tan2014-09-021-0/+30
| | | | Fixes https://github.com/rails/rails/issues/9933.
* Add Missing Test Cases for the constantizeAditya Kapoor2014-06-071-0/+11
|
* Fix #10932. Treat "" and "::" as invalid on constantizeNikolay Shebanov2013-06-141-4/+4
|
* cleaning up constantize testsAaron Patterson2012-11-071-44/+44
|
* Handle case where ancestor is not the end of the chainAndrew White2012-05-191-0/+2
|
* Fix constantize so top level constants are looked up properly.Marc-Andre Lafortune2012-05-191-0/+18
|
* Make constantize look down the ancestor chain (excluding Object)Marc-Andre Lafortune2012-05-191-0/+17
|
* safe_constantize should handle wrong constant name NameErrors Fixes #4710Alex Tambellini2012-01-261-2/+3
|
* Ensure that constantize just rescues NameError that applies to the constant ↵José Valim2011-09-231-0/+6
| | | | being currently loaded.
* Added ActiveSupport::Inflector.safe_constantize and String#safe_constantize; ↵Ryan Oblak2011-09-231-0/+31
refactored common constantize tests into ConstantizeTestCases