Use lambda to dynamically evaluate allowed user api key client scopes (#30544)

This commit is contained in:
Angus McLeod 2025-01-03 16:25:21 +01:00 committed by GitHub
parent 13b9493bf0
commit 4d5be463f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@ class UserApiKeyClientScope < ActiveRecord::Base
validates :name, validates :name,
inclusion: { inclusion: {
in: UserApiKeyScope.all_scopes.keys.map(&:to_s), in: -> { UserApiKeyScope.all_scopes.keys.map(&:to_s) },
message: "%{value} is not a valid scope", message: "%{value} is not a valid scope",
} }