Skip to content

Commit 0a1d922

Browse files
committed
[Fix #1031] Make Lint/SafeNavigationChain allow presence_in
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
1 parent 34376e0 commit 0a1d922

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#1031](https://github.com/rubocop/rubocop-rails/pull/1031): Make `Lint/SafeNavigationChain` allow `presence_in`. ([@koic][])

config/default.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ Lint/RedundantSafeNavigation:
6161
- presence
6262
- present?
6363

64+
Lint/SafeNavigationChain:
65+
# Add `presence_in` method to the default of the RuboCop core:
66+
# https://github.com/rubocop/rubocop/blob/v1.56.0/config/default.yml#L2265-L2271
67+
AllowedMethods:
68+
- present?
69+
- blank?
70+
- presence
71+
- presence_in
72+
- try
73+
- try!
74+
- in?
75+
6476
Rails:
6577
Enabled: true
6678
DocumentationBaseURL: https://docs.rubocop.org/rubocop-rails

0 commit comments

Comments
 (0)