From f4562a16336c3517de33a071e3febf90dd2992d1 Mon Sep 17 00:00:00 2001 From: Renzo Date: Wed, 8 Feb 2023 16:13:09 -0300 Subject: [PATCH] chore: use variable instead of calling node.parent_module_name again --- .../lib/rubocop/cop/airbnb/spec_constant_assignment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb b/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb index 7e94de6..92ff742 100644 --- a/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb +++ b/rubocop-airbnb/lib/rubocop/cop/airbnb/spec_constant_assignment.rb @@ -33,7 +33,7 @@ class SpecConstantAssignment < Base def on_casgn(node) return unless in_spec_file?(node) parent_module_name = node.parent_module_name - if node.parent_module_name && parent_module_name != "Object" + if parent_module_name && parent_module_name != "Object" return end add_offense(node, message: MESSAGE)