• K
    Fix safe_constantize to not raise a LoadError. · a930f5ba
    Keenan Brock 提交于
    ### 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
    ```
    a930f5ba
可在Tags中查看这些版本中当前仓库的状态.
CHANGELOG.md 9.1 KB