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

Make keys method aware of Rails/DeprecatedActiveModelErrorsMethods cop #702

Commits on May 4, 2022

  1. Make keys method aware of `Rails/DeprecatedActiveModelErrorsMethods…

    …` cop
    
    This PR makes `keys` method aware of `Rails/DeprecatedActiveModelErrorsMethods` cop.
    It can emulate the following Rails's warning.
    
    ```console
    DEPRECATION WARNING: ActiveModel::Errors#keys is deprecated and will be removed in Rails 6.2.
    ```
    
    The following is a bad / good example.
    
    ```ruby
    # bad
    user.errors.keys.include?(:attr)
    
    # good
    user.errors.attribute_names.include?(:attr)
    ```
    koic committed May 4, 2022
    Configuration menu
    Copy the full SHA
    37ff253 View commit details
    Browse the repository at this point in the history