-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
07cfcb4
commit 7eecd2c
Showing
4 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#614](https://github.com/rubocop/rubocop-rails/pull/614): Add `IgnoreScopes` config option for `Rails/InverseOf` cop. ([@composerinteralia][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters