1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/lib/active_support
Keenan Brock a930f5ba06 Fix safe_constantize to not raise a LoadError.
### Summary

There was an issues when using `safe_constantize` on a string that has
the wrong case.

File `em.rb` defines `EM`.
`"Em".safe_constantize` causes a little confusion with the autoloader.
The autoloader finds file "em.rb",
expecting it to define `Em`, but `Em` is not defined.
The autoloader raises a `LoadError`, which is good,
But `safe_constantize` is defined to return `nil` when a class is not found.

### Before

```
"Em".safe_constantize
LoadError: Unable to autoload constant Em, \
expected rails/activesupport/test/autoloading_fixtures/em.rb to define it
```

### After

```
"Em".safe_constantize
# => nil
```
2019-01-09 14:52:46 -05:00
..
cache Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
concurrency Prevent deadlocks with load interlock and DB lock. 2017-11-09 10:46:01 -05:00
core_ext Clarify delegate_missing_to [ci skip] 2019-01-04 22:18:00 +02:00
dependencies [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
deprecation Module#{define_method,alias_method,undef_method,remove_method} become public since Ruby 2.5 2018-12-21 01:39:18 +09:00
duration Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
inflector Fix safe_constantize to not raise a LoadError. 2019-01-09 14:52:46 -05:00
json Upgrade Rubocop to 0.61.1 and fix offenses 2018-12-10 19:22:56 -02:00
locale Improve the performance of ActiveSupport::Inflector.ordinal 2018-04-29 20:21:58 +09:00
log_subscriber [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
messages Fix RotationConfiguration test and remove nil-kind rotates. 2017-09-24 22:58:17 +02:00
multibyte Use String#truncate_bytes inside Multibyte::Chars#limit 2018-10-20 12:00:37 -07:00
notifications Don't expose internal clock_gettime_supported? class method 2018-11-30 21:14:12 +09:00
number_helper Missing require "active_support/number_helper/number_converter" 2018-10-20 14:58:04 +09:00
testing Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
values Privatize and add # :nodoc: to constants 2018-10-28 17:51:22 +01:00
xml_mini Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
all.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
array_inquirer.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
backtrace_cleaner.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
benchmarkable.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
builder.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
cache.rb Preserve key order passed to ActiveSupport::CacheStore#fetch_multi 2018-12-27 01:39:43 -06:00
callbacks.rb Make it easier to find abort documentation 2018-10-01 11:49:07 +02:00
concern.rb Do nothing when the same block is included again. 2018-11-29 18:37:06 +00:00
configurable.rb Consistently use kwargs for instance_{reader,writer,accessor} options 2018-10-20 15:48:13 +09:00
core_ext.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
current_attributes.rb Missing require "active_support/callbacks" 2018-10-20 14:58:04 +09:00
dependencies.rb Improve the logic that detects non-autoloaded constants 2018-10-28 16:34:50 +01:00
deprecation.rb Update default deprecation horizon 2018-01-31 14:27:45 +09:00
descendants_tracker.rb Upgrade Rubocop to 0.61.1 and fix offenses 2018-12-10 19:22:56 -02:00
digest.rb Don't include ellipsis in truncated digest output 2017-12-17 00:49:02 +00:00
duration.rb Duration#coerce should always return a Scalar 2019-01-08 15:05:40 -08:00
encrypted_configuration.rb Bugfix: ActiveSupport::EncryptedConfiguration reading of comment-only encrypted files (#34014) 2018-10-05 08:06:33 +09:00
encrypted_file.rb Change temporary file name extension while editing encrypted file. 2018-03-18 21:29:41 +01:00
evented_file_update_checker.rb Merge pull request #34764 from kamipo/avoid_redundant_begin 2018-12-21 17:36:30 +09:00
execution_wrapper.rb Missing require "concurrent/hash" 2018-10-20 14:58:04 +09:00
executor.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
file_update_checker.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
gem_version.rb Start Rails 6.0 development!!! 2018-01-30 18:51:17 -05:00
gzip.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
hash_with_indifferent_access.rb Make #to_options an alias for #symbolize_keys 2018-11-01 09:12:56 -07:00
i18n.rb ActiveSupport::Inflector#ordinal and ActiveSupport::Inflector#ordinalize 2018-03-05 08:41:49 -05:00
i18n_railtie.rb Fix typo in i18n_railtie.rb 2018-09-06 15:09:24 -04:00
inflections.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
inflector.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
json.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
key_generator.rb Fix typo 'in via' 2018-07-06 22:46:53 +02:00
lazy_load_hooks.rb A Class is a Module so we remove one conditional 2018-07-04 14:55:53 -04:00
log_subscriber.rb Fix examples in ActiveSupport::LogSubscriber docs 2019-01-01 20:27:54 -05:00
logger.rb Fix the LoggerSilence to work as described: 2018-10-02 17:17:23 -04:00
logger_silence.rb Fix the LoggerSilence to work as described: 2018-10-02 17:17:23 -04:00
logger_thread_safe_level.rb Fix the LoggerSilence to work as described: 2018-10-02 17:17:23 -04:00
message_encryptor.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
message_verifier.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
multibyte.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
notifications.rb Merge pull request #34707 from xlts/update-notifications-docs 2018-12-31 15:11:53 -05:00
number_helper.rb Missing require "active_support/dependencies/autoload" 2018-10-20 14:58:04 +09:00
option_merger.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
ordered_hash.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
ordered_options.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
parameter_filter.rb Implement AR#inspect using ParamterFilter. 2018-10-19 14:16:03 +09:00
per_thread_registry.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
proxy_object.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
rails.rb Rails 6 requires Ruby 2.4.1+ 2018-02-17 15:34:57 -08:00
railtie.rb Use SHA-1 for non-sensitive digests by default 2018-01-08 20:45:46 +00:00
reloader.rb Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
rescuable.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
security_utils.rb Compare the actual string after comparing the HMAC proccessed strings 2017-11-25 11:39:41 -05:00
string_inquirer.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
subscriber.rb Rename event variable 2018-10-21 17:43:34 +02:00
tagged_logging.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
test_case.rb Add option to set parallel test worker count to the physical core count of the machine (#34735) 2018-12-18 10:25:35 -08:00
time.rb [Active Support] require_relative => require 2017-10-21 22:48:27 +09:00
time_with_zone.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
version.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
xml_mini.rb Add missing require for String#to_d 2018-12-21 18:12:10 +09:00