Skip to content

Commit

Permalink
[Fix #1058] Relax Include path for Rails/FindBy and Rails/FindEach
Browse files Browse the repository at this point in the history
Fixes #1058.

This PR relaxes `Include` path for `Rails/FindBy` and `Rails/FindEach`.

`Rails/FindBy` was introduced in rubocop/rubocop@6188d75.
This was before it was extracted to RuboCop Rails, which is probably why it was
targeting `app/models`. So, RuboCop Rails targeting Rails would not need it.

`Rails/FindEach` is the same:
rubocop/rubocop@f2e26812
  • Loading branch information
koic committed Aug 2, 2023
1 parent 34376e0 commit 0066b35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1058](https://github.com/rubocop/rubocop-rails/issues/1058): Relax `Include` path for `Rails/FindBy` and `Rails/FindEach`. ([@koic][])
8 changes: 2 additions & 6 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,8 @@ Rails/FindBy:
StyleGuide: 'https://rails.rubystyle.guide#find_by'
Enabled: true
VersionAdded: '0.30'
VersionChanged: '2.11'
VersionChanged: '<<next>>'
IgnoreWhereFirst: true
Include:
- app/models/**/*.rb

Rails/FindById:
Description: >-
Expand All @@ -482,9 +480,7 @@ Rails/FindEach:
Enabled: true
Safe: false
VersionAdded: '0.30'
VersionChanged: '2.19'
Include:
- app/models/**/*.rb
VersionChanged: '<<next>>'
AllowedMethods:
# Methods that don't work well with `find_each`.
- order
Expand Down

0 comments on commit 0066b35

Please sign in to comment.