Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Thor::CoreExt::HashWithIndifferentAccess#except for Rails 6.0 #734

Merged
merged 1 commit into from
Feb 11, 2021

Commits on Jul 30, 2020

  1. Support Thor::CoreExt::HashWithIndifferentAccess#except for Rails 6.0

    This PR supports `Thor::CoreExt::HashWithIndifferentAccess#except`
    and prevents breaking changes in Rails upgrades when using
    `options.except(:key)` in Thor task.
    
    When Thor is used with Rails (Active Support), the behavior changes as follows.
    
    ## With Rails 5.2 or lower
    
    ```ruby
    h = Thor::CoreExt::HashWithIndifferentAccess.new(foo: 1, bar: 2)
    h.except(:foo) #=> {"bar"=>2}
    ```
    
    ## With Rails 6.0
    
    ```ruby
    h = Thor::CoreExt::HashWithIndifferentAccess.new(foo: 1, bar: 2)
    h.except(:foo) #=> {"foo"=>1, "bar"=>2}
    ```
    
    This difference behavior is due to the following changes in Rails 6.0.
    rails/rails#35771
    
    This PR makes the behavior between Rails 5.2 and Rails 6.0 compatible.
    koic committed Jul 30, 2020
    Configuration menu
    Copy the full SHA
    99a15e6 View commit details
    Browse the repository at this point in the history