Skip to content

Commit

Permalink
[Fix rubocop#778] Fix a false positive for Rails/DynamicFindBy
Browse files Browse the repository at this point in the history
Fixes rubocop#778.

This PR fixes a false positive for `Rails/DynamicFindBy`
when using `page.find_by_id` as a Capybara testing API.
This default setting emphasizes suppressing false positive over false negative.
  • Loading branch information
koic committed Sep 21, 2022
1 parent b4e2d7e commit 52f616c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/fix_false_positive_for_rails_dynamic_find_by.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#778](https://github.com/rubocop/rubocop-rails/issues/778): Fix a false positive for `Rails/DynamicFindBy` when using `page.find_by_id` as a Capybara testing API. ([@koic][])
1 change: 1 addition & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ Rails/DynamicFindBy:
- find_by_sql
AllowedReceivers:
- Gem::Specification
- page # Prevents a warning for `page.find_by_id`. See: https://github.com/rubocop/rubocop-rails/issues/778

Rails/EagerEvaluationLogMessage:
Description: 'Checks that blocks are used for interpolated strings passed to `Rails.logger.debug`.'
Expand Down

0 comments on commit 52f616c

Please sign in to comment.