From 5ad0f6690492ae4af2a188ec2de42a03357fbb46 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 12 May 2025 16:30:29 +0100 Subject: [PATCH] Fix variable naming in `Rails/ViewRenderLiteral` - Fixes https://github.com/github/rubocop-github/security/code-scanning/4 and https://github.com/github/rubocop-github/security/code-scanning/5 by fixing the typo for singular vs. plural `option_pairs` vs. `options_pairs`. --- lib/rubocop/cop/github/rails_view_render_literal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rubocop/cop/github/rails_view_render_literal.rb b/lib/rubocop/cop/github/rails_view_render_literal.rb index c8563868..357b2ee1 100644 --- a/lib/rubocop/cop/github/rails_view_render_literal.rb +++ b/lib/rubocop/cop/github/rails_view_render_literal.rb @@ -54,7 +54,7 @@ def on_send(node) if render_literal?(node) && node.arguments.count > 1 locals = node.arguments[1] - elsif options_pairs = render_with_options?(node) + elsif option_pairs = render_with_options?(node) locals = option_pairs.map { |pair| locals_key?(pair) }.compact.first end