Skip to content

Commit

Permalink
Suppress a new RuboCop offense
Browse files Browse the repository at this point in the history
Follow up rubocop/rubocop#12383

This commit suppresses the following new RuboCop offense:

```console
$ bundle exec rubocop
(snip)

lib/rubocop/cop/rails/validation.rb:54:44: W: [Correctable] Lint/SymbolConversion: Unnecessary symbol conversion; use :"validates_#{p}_of" instead.
        RESTRICT_ON_SEND = TYPES.map { |p| "validates_#{p}_of".to_sym }.freeze
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^

292 files inspected, 1 offense detected, 1 offense autocorrectable
```
  • Loading branch information
koic committed Nov 21, 2023
1 parent 9d90b6c commit 13a9061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Validation < Base
uniqueness
].freeze

RESTRICT_ON_SEND = TYPES.map { |p| "validates_#{p}_of".to_sym }.freeze
RESTRICT_ON_SEND = TYPES.map { |p| :"validates_#{p}_of" }.freeze
ALLOWLIST = TYPES.map { |p| "validates :column, #{p}: value" }.freeze

def on_send(node)
Expand Down

0 comments on commit 13a9061

Please sign in to comment.