1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

18 commits

Author SHA1 Message Date
Koichi ITO
ac717d65a3 [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
Kir Shatrov
72950568dd Use frozen-string-literal in ActiveSupport 2017-07-09 15:08:29 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
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
Xavier Noria
a731125f12 applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
Yves Senn
2aad0b4168 Merge pull request #21250 from ronakjangir47/safe_const
safe_constantize - Added Object scoped missing test cases
2015-09-07 08:52:36 +02:00
Ronak Jangir
f96c7d963c safe_constantize - Added Object scoped missing test cases 2015-09-06 13:34:24 +05:30
Guo Xiang Tan
6e0f273dfd Use safe_constantize.
Fixes https://github.com/rails/rails/issues/9933.
2014-09-02 00:41:00 +08:00
Aditya Kapoor
885ebda266 Add Missing Test Cases for the constantize 2014-06-07 23:58:38 +05:30
Nikolay Shebanov
7fd36f307a Fix #10932. Treat "" and "::" as invalid on constantize 2013-06-14 11:20:15 +04:00
Aaron Patterson
4a7679ebca cleaning up constantize tests 2012-11-07 17:13:17 +09:00
Andrew White
3d0e4895cd Handle case where ancestor is not the end of the chain 2012-05-19 15:47:35 +01:00
Marc-Andre Lafortune
eb09411460 Fix constantize so top level constants are looked up properly. 2012-05-19 15:47:35 +01:00
Marc-Andre Lafortune
99e9a733c8 Make constantize look down the ancestor chain (excluding Object) 2012-05-19 15:47:35 +01:00
Alex Tambellini
7598284c0b safe_constantize should handle wrong constant name NameErrors Fixes #4710 2012-01-26 14:19:49 -05:00
José Valim
b2f34d1e35 Ensure that constantize just rescues NameError that applies to the constant being currently loaded. 2011-09-23 16:21:49 +02:00
Ryan Oblak
310565f537 Added ActiveSupport::Inflector.safe_constantize and String#safe_constantize; refactored common constantize tests into ConstantizeTestCases 2011-09-23 15:36:33 +02:00