FIX: 2N+1 sql in admin /api/keys endpoint (#14679)

FIX: 2N+1 sql in admin /api/keys endpoint (#14679)

diff --git a/app/controllers/admin/api_controller.rb b/app/controllers/admin/api_controller.rb
index 513aa4b..e045131 100644
--- a/app/controllers/admin/api_controller.rb
+++ b/app/controllers/admin/api_controller.rb
@@ -5,7 +5,9 @@ class Admin::ApiController < Admin::AdminController
   # If we used "api_key", then our user provider would try to use the value for authentication
 
   def index
-    keys = ApiKey.where(hidden: false)
+    keys = ApiKey
+      .where(hidden: false)
+      .includes(:user, :api_key_scopes)
 
     # Put active keys first
     # Sort active keys by created_at, sort revoked keys by revoked_at

GitHub sha: 3b90d7de66178733cbf8cae5a824aceb7ad21350

This commit appears in #14679 which was approved by pmusaraj. It was merged by CvX.