diff --git a/lib/rubocop/cop/rails/delegate.rb b/lib/rubocop/cop/rails/delegate.rb index 0e1bb5907c..69be94405b 100644 --- a/lib/rubocop/cop/rails/delegate.rb +++ b/lib/rubocop/cop/rails/delegate.rb @@ -100,7 +100,7 @@ def arguments_match?(arg_array, body) def method_name_matches?(method_name, body) method_name == body.method_name || - include_prefix_case? && method_name == prefixed_method_name(body) + (include_prefix_case? && method_name == prefixed_method_name(body)) end def include_prefix_case? diff --git a/lib/rubocop/cop/rails/dynamic_find_by.rb b/lib/rubocop/cop/rails/dynamic_find_by.rb index 75358c8367..1ef798f9cc 100644 --- a/lib/rubocop/cop/rails/dynamic_find_by.rb +++ b/lib/rubocop/cop/rails/dynamic_find_by.rb @@ -40,7 +40,7 @@ class DynamicFindBy < Base IGNORED_ARGUMENT_TYPES = %i[hash splat].freeze def on_send(node) - return if node.receiver.nil? && !inherit_active_record_base?(node) || allowed_invocation?(node) + return if (node.receiver.nil? && !inherit_active_record_base?(node)) || allowed_invocation?(node) method_name = node.method_name static_name = static_method_name(method_name) diff --git a/lib/rubocop/cop/rails/http_positional_arguments.rb b/lib/rubocop/cop/rails/http_positional_arguments.rb index a775a2024a..07f437c7db 100644 --- a/lib/rubocop/cop/rails/http_positional_arguments.rb +++ b/lib/rubocop/cop/rails/http_positional_arguments.rb @@ -69,7 +69,7 @@ def needs_conversion?(data) data.each_pair.none? do |pair| special_keyword_arg?(pair.key) || - format_arg?(pair.key) && data.pairs.one? + (format_arg?(pair.key) && data.pairs.one?) end end diff --git a/lib/rubocop/cop/rails/pluralization_grammar.rb b/lib/rubocop/cop/rails/pluralization_grammar.rb index 8abe9a0352..9635a780f2 100644 --- a/lib/rubocop/cop/rails/pluralization_grammar.rb +++ b/lib/rubocop/cop/rails/pluralization_grammar.rb @@ -61,8 +61,8 @@ def correct_method(method_name) def offense?(node) number, = *node.receiver - singular_receiver?(number) && plural_method?(node.method_name) || - plural_receiver?(number) && singular_method?(node.method_name) + (singular_receiver?(number) && plural_method?(node.method_name)) || + (plural_receiver?(number) && singular_method?(node.method_name)) end def plural_method?(method_name) diff --git a/lib/rubocop/cop/rails/reversible_migration.rb b/lib/rubocop/cop/rails/reversible_migration.rb index 36f5f05117..4bafa6fbaf 100644 --- a/lib/rubocop/cop/rails/reversible_migration.rb +++ b/lib/rubocop/cop/rails/reversible_migration.rb @@ -343,8 +343,8 @@ def within_change_method?(node) def within_reversible_or_up_only_block?(node) node.each_ancestor(:block).any? do |ancestor| - ancestor.block_type? && - ancestor.send_node.method?(:reversible) || + (ancestor.block_type? && + ancestor.send_node.method?(:reversible)) || ancestor.send_node.method?(:up_only) end end