diff --git a/changelog/change_make_lint_safe_navigation_chain_allow_presence_in.md b/changelog/change_make_lint_safe_navigation_chain_allow_presence_in.md new file mode 100644 index 0000000000..6296f73c7e --- /dev/null +++ b/changelog/change_make_lint_safe_navigation_chain_allow_presence_in.md @@ -0,0 +1 @@ +* [#1031](https://github.com/rubocop/rubocop-rails/pull/1031): Make `Lint/SafeNavigationChain` allow `presence_in`. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index 704ba72ca2..6c4e7dcad1 100644 --- a/config/default.yml +++ b/config/default.yml @@ -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