From dc1e7fbd1e0df547bd89edb36507a266490910f6 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Wed, 1 Nov 2023 12:06:28 +0100 Subject: [PATCH] Fix Style/AndOr offense This commit replaces the use of `or` with `||` in conditional statements to adhere to Ruby best practices and improve code readability. The change does not affect the functionality of the code. `||` and `or` are both logical OR operators in Ruby and behave the same way in simple `if` statements. This change was made to ensure consistency in the codebase and to follow the recommendations of RuboCop This change is safe and does not introduce any breaking changes. It's purely a style and readability improvement. Co-Author: Phind Model GPT-4 --- .rubocop_todo.yml | 9 +-------- lib/chrono_model/adapter.rb | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4d7c485..81e0a27 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.57.1. +# using RuboCop version 1.57.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -57,13 +57,6 @@ Rails/SquishedSQLHeredocs: - 'lib/chrono_model/adapter/indexes.rb' - 'lib/chrono_model/adapter/upgrade.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, conditionals -Style/AndOr: - Exclude: - - 'lib/chrono_model/adapter.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: Exclude: diff --git a/lib/chrono_model/adapter.rb b/lib/chrono_model/adapter.rb index eb52fcd..519a941 100644 --- a/lib/chrono_model/adapter.rb +++ b/lib/chrono_model/adapter.rb @@ -113,7 +113,7 @@ def on_schema(schema, recurse: :follow) old_path = schema_search_path count_recursions do - if recurse == :follow or Thread.current['recursions'] == 1 + if (recurse == :follow) || (Thread.current['recursions'] == 1) self.schema_search_path = schema end