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

Allow ignoring scopes for inverse_of cop #614

Merged
merged 1 commit into from
Jan 11, 2022

Commits on Jan 11, 2022

  1. Allow ignoring scopes for inverse_of cop

    With rails/rails#43358, Rails can now infer
    inverse_of for associations with a scope when
    `config.active_record.automatic_scope_inversing = true`.
    
    This commit adds an `IgnoreScopes` option to the inverse_of cop allowing
    us to disable the cop for scopes when the new Rails option is set to
    `true`.
    
    I considered having the default for `IgnoreScopes` change based on the
    Rails version since this is the default for new Rails >= 7.0
    applications, but existing applications that upgrade to 7.0 wouldn't
    necessarily have the option set and in that case changing the
    rubocop-rails default behavior would be a breaking change.
    composerinteralia committed Jan 11, 2022
    Configuration menu
    Copy the full SHA
    95b3e8c View commit details
    Browse the repository at this point in the history