Add and apply Style/CollectionQuerying rubocop rule

This rule was added in rubocop 1.77. We were following it most of the
time. It makes the code more readable in my humble opinion.
This commit is contained in:
Javi Martín
2025-10-31 14:31:35 +01:00
parent 1fa3cf8ce7
commit 7f749bb9bb
9 changed files with 14 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
# Default admin user (change password after first deploy to a server!)
if Administrator.count == 0 && (!Rails.env.test? || !Tenant.default?)
if Administrator.none? && (!Rails.env.test? || !Tenant.default?)
admin = User.create!(username: "admin", email: "admin@consul.dev", password: "12345678",
password_confirmation: "12345678", confirmed_at: Time.current,
terms_of_service: "1")