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

This issue was introduced in 1ba9b34b03, when the scopes were changed from an array of strings to a dedicated table
This commit is contained in:
David Taylor 2020-10-08 18:12:24 +01:00 committed by GitHub
parent 68524f72aa
commit e47b847ac2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,7 @@ class UserSerializer < UserCardSerializer
{ {
id: k.id, id: k.id,
application_name: k.application_name, 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, created_at: k.created_at,
last_used_at: k.last_used_at, last_used_at: k.last_used_at,
} }