Skip to content

Commit

Permalink
[Fix #1031] Make Lint/SafeNavigationChain allow presence_in
Browse files Browse the repository at this point in the history
Fixes #1031.

This PR makes `Lint/SafeNavigationChain` allow `presence_in`.

It adds `presence_in` method to the default of the RuboCop core:
https://github.com/rubocop/rubocop/blob/v1.56.0/config/default.yml#L2265-L2271
  • Loading branch information
koic committed Aug 15, 2023
1 parent 34376e0 commit 0a1d922
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1031](https://github.com/rubocop/rubocop-rails/pull/1031): Make `Lint/SafeNavigationChain` allow `presence_in`. ([@koic][])
12 changes: 12 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ Lint/RedundantSafeNavigation:
- presence
- present?

Lint/SafeNavigationChain:
# Add `presence_in` method to the default of the RuboCop core:
# https://github.com/rubocop/rubocop/blob/v1.56.0/config/default.yml#L2265-L2271
AllowedMethods:
- present?
- blank?
- presence
- presence_in
- try
- try!
- in?

Rails:
Enabled: true
DocumentationBaseURL: https://docs.rubocop.org/rubocop-rails
Expand Down

0 comments on commit 0a1d922

Please sign in to comment.