Skip to content

Commit b61bbfb

Browse files
authored
Merge pull request #1069 from koic/make_lint_safe_navigation_chain_allow_presence_in
[Fix #1031] Make `Lint/SafeNavigationChain` allow `presence_in`
2 parents 3bc0e2d + 0a1d922 commit b61bbfb

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)