Skip to content

Commit 63d4f99

Browse files
authored
Merge pull request rails#45631 from fatkodima/rubocop-enable-redundant-condition
Enable `Style/RedundantCondition` cop
2 parents e8f189b + 8651999 commit 63d4f99

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ Style/ColonMethodCall:
266266
Style/TrivialAccessors:
267267
Enabled: true
268268

269+
# Prefer a = b || c over a = b ? b : c
270+
Style/RedundantCondition:
271+
Enabled: true
272+
269273
Performance/BindCall:
270274
Enabled: true
271275

activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def reset_pk_sequence!(table, pk = nil, sequence = nil) # :nodoc:
297297
end
298298
end
299299

300-
query_value("SELECT setval(#{quote(quoted_sequence)}, #{max_pk ? max_pk : minvalue}, #{max_pk ? true : false})", "SCHEMA")
300+
query_value("SELECT setval(#{quote(quoted_sequence)}, #{max_pk || minvalue}, #{max_pk ? true : false})", "SCHEMA")
301301
end
302302
end
303303

0 commit comments

Comments
 (0)