diff --git a/backend/app/controllers/api/admin_controller.rb b/backend/app/controllers/api/admin_controller.rb index 6c128ee..7d8c1db 100644 --- a/backend/app/controllers/api/admin_controller.rb +++ b/backend/app/controllers/api/admin_controller.rb @@ -17,10 +17,9 @@ def data discord: User.where.not(discord_id: nil).count }, files: - FileResource - .all - .group_by(&:kind) - .transform_values(&:count), + FileResource.kinds.transform_values do |kind| + FileResource.where(kind:).count + end, db: ActiveRecord::Base.connection_pool.stat } }