style: formalize preference for if/unless in rubocop (#2816)

This commit is contained in:
Mike Dalessio
2026-04-09 11:14:52 -04:00
committed by GitHub
parent d562e79440
commit 3a30d7796f
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -13,3 +13,8 @@ AllCops:
- 'db/schema*.rb'
- 'saas/db/migrate/**/*'
- 'saas/db/saas_schema.rb'
Style/NegatedIf:
Enabled: true
Style/NegatedUnless:
Enabled: true
+1 -1
View File
@@ -39,7 +39,7 @@ module User::Avatar
private
def avatar_content_type_allowed
if !ALLOWED_AVATAR_CONTENT_TYPES.include?(avatar.content_type)
unless ALLOWED_AVATAR_CONTENT_TYPES.include?(avatar.content_type)
errors.add(:avatar, "must be a JPEG, PNG, GIF, or WebP image")
end
end
+1 -1
View File
@@ -22,7 +22,7 @@ if Fizzy.saas?
plugin :yabeda_prometheus
end
if !Rails.env.local?
unless Rails.env.local?
# Because we expect fewer I/O waits than Rails apps that connect to the
# database over the network, let's start with a baseline config of 1
# worker per CPU, 1 thread per worker and tune it from there.