Skip to content

Commit

Permalink
Use Node#any_block_type?
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Jan 27, 2025
1 parent 27c9a21 commit 428a452
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/pluck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Pluck < Base
minimum_target_rails_version 5.0

def_node_matcher :pluck_candidate?, <<~PATTERN
({block numblock} (call _ {:map :collect}) $_argument (send lvar :[] $_key))
(any_block (call _ {:map :collect}) $_argument (send lvar :[] $_key))
PATTERN

def on_block(node)
Expand Down
2 changes: 1 addition & 1 deletion rubocop-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ Gem::Specification.new do |s|
# introduced in rack 1.1
s.add_dependency 'rack', '>= 1.1'
s.add_dependency 'rubocop', '>= 1.52.0', '< 2.0'
s.add_dependency 'rubocop-ast', '>= 1.31.1', '< 2.0'
s.add_dependency 'rubocop-ast', '>= 1.38.0', '< 2.0'
end

0 comments on commit 428a452

Please sign in to comment.