Skip to content

Commit 7e21774

Browse files
committed
Suppress RuboCop's offenses
Follow-up to rubocop/rubocop#13929 This commit suppresses the following RuboCop's offenses: ```console $ bundle exec rubocop (snip) lib/rubocop/cop/mixin/active_record_helper.rb:106:40: C: [Correctable] InternalAffairs/NodeTypeGroup: Use :call instead of individually listing group types. send_node = node.each_ancestor(:send, :csend).first ^^^^^^^^^^^^^ lib/rubocop/cop/rails/pluck.rb:63:40: C: [Correctable] InternalAffairs/NodeTypeGroup: Use :any_block instead of individually listing group types. return if node.each_ancestor(:block, :numblock).any? ^^^^^^^^^^^^^^^^^ 301 files inspected, 2 offenses detected, 2 offenses autocorrectable ```
1 parent a250bfa commit 7e21774

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rubocop/cop/mixin/active_record_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def polymorphic?(belongs_to)
103103
end
104104

105105
def in_where?(node)
106-
send_node = node.each_ancestor(:send, :csend).first
106+
send_node = node.each_ancestor(:call).first
107107
return false unless send_node
108108

109109
return true if WHERE_METHODS.include?(send_node.method_name)

lib/rubocop/cop/rails/pluck.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Pluck < Base
6060
PATTERN
6161

6262
def on_block(node)
63-
return if node.each_ancestor(:block, :numblock).any?
63+
return if node.each_ancestor(:any_block).any?
6464

6565
pluck_candidate?(node) do |argument, key|
6666
next if key.regexp_type? || !use_one_block_argument?(argument)

0 commit comments

Comments
 (0)