From 0066b35056c50484f950de33ba7e674ef9e0f971 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Thu, 3 Aug 2023 02:40:19 +0900 Subject: [PATCH] [Fix #1058] Relax `Include` path for `Rails/FindBy` and `Rails/FindEach` Fixes #1058. This PR relaxes `Include` path for `Rails/FindBy` and `Rails/FindEach`. `Rails/FindBy` was introduced in https://github.com/rubocop/rubocop/commit/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: https://github.com/rubocop/rubocop/commit/f2e26812 --- ..._relax_include_path_for_rails_find_by_and_find_each.md | 1 + config/default.yml | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 changelog/change_relax_include_path_for_rails_find_by_and_find_each.md diff --git a/changelog/change_relax_include_path_for_rails_find_by_and_find_each.md b/changelog/change_relax_include_path_for_rails_find_by_and_find_each.md new file mode 100644 index 0000000000..c620585975 --- /dev/null +++ b/changelog/change_relax_include_path_for_rails_find_by_and_find_each.md @@ -0,0 +1 @@ +* [#1058](https://github.com/rubocop/rubocop-rails/issues/1058): Relax `Include` path for `Rails/FindBy` and `Rails/FindEach`. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index 704ba72ca2..a6675f02ac 100644 --- a/config/default.yml +++ b/config/default.yml @@ -463,10 +463,8 @@ Rails/FindBy: StyleGuide: 'https://rails.rubystyle.guide#find_by' Enabled: true VersionAdded: '0.30' - VersionChanged: '2.11' + VersionChanged: '<>' IgnoreWhereFirst: true - Include: - - app/models/**/*.rb Rails/FindById: Description: >- @@ -482,9 +480,7 @@ Rails/FindEach: Enabled: true Safe: false VersionAdded: '0.30' - VersionChanged: '2.19' - Include: - - app/models/**/*.rb + VersionChanged: '<>' AllowedMethods: # Methods that don't work well with `find_each`. - order