From 3a30d7796f542a8b09802960a539b890e14cad55 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 11:14:52 -0400 Subject: [PATCH] style: formalize preference for if/unless in rubocop (#2816) --- .rubocop.yml | 5 +++++ app/models/user/avatar.rb | 2 +- config/puma.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c0d945b70..f06669aab 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,3 +13,8 @@ AllCops: - 'db/schema*.rb' - 'saas/db/migrate/**/*' - 'saas/db/saas_schema.rb' + +Style/NegatedIf: + Enabled: true +Style/NegatedUnless: + Enabled: true diff --git a/app/models/user/avatar.rb b/app/models/user/avatar.rb index 02e437630..bdc14ba77 100644 --- a/app/models/user/avatar.rb +++ b/app/models/user/avatar.rb @@ -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 diff --git a/config/puma.rb b/config/puma.rb index 70ca6ebb4..d3e65c671 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -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.