FIX: Use scope name when serializing UserApiKeys (#10871)

FIX: Use scope name when serializing UserApiKeys (#10871)

This issue was introduced in 1ba9b34b034c2a27c9e04f430eefbccae5942bcf, when the scopes were changed from an array of strings to a dedicated table

diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb
index 594b3fb..3935ce2 100644
--- a/app/serializers/user_serializer.rb
+++ b/app/serializers/user_serializer.rb
@@ -131,7 +131,7 @@ class UserSerializer < UserCardSerializer
       {
         id: k.id,
         application_name: k.application_name,
-        scopes: k.scopes.map { |s| I18n.t("user_api_key.scopes.#{s}") },
+        scopes: k.scopes.map { |s| I18n.t("user_api_key.scopes.#{s.name}") },
         created_at: k.created_at,
         last_used_at: k.last_used_at,
       }

GitHub sha: e47b847a

This commit appears in #10871 which was approved by eviltrout. It was merged by davidtaylorhq.