diff --git a/.rubocop.yml b/.rubocop.yml index 5bbdd114470..81bd763e059 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -266,6 +266,10 @@ Style/ColonMethodCall: Style/TrivialAccessors: Enabled: true +# Prefer a = b || c over a = b ? b : c +Style/RedundantCondition: + Enabled: true + Performance/BindCall: Enabled: true diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index 6ea900c9a24..89446d78cf7 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -297,7 +297,7 @@ module ActiveRecord end end - query_value("SELECT setval(#{quote(quoted_sequence)}, #{max_pk ? max_pk : minvalue}, #{max_pk ? true : false})", "SCHEMA") + query_value("SELECT setval(#{quote(quoted_sequence)}, #{max_pk || minvalue}, #{max_pk ? true : false})", "SCHEMA") end end