parent
9f7d75fd4e
commit
961d43a97b
|
@ -4,6 +4,7 @@ class DeployToken < ActiveRecord::Base
|
||||||
include Expirable
|
include Expirable
|
||||||
include TokenAuthenticatable
|
include TokenAuthenticatable
|
||||||
include PolicyActor
|
include PolicyActor
|
||||||
|
include Gitlab::Utils::StrongMemoize
|
||||||
add_authentication_token_field :token
|
add_authentication_token_field :token
|
||||||
|
|
||||||
AVAILABLE_SCOPES = %i(read_repository read_registry).freeze
|
AVAILABLE_SCOPES = %i(read_repository read_registry).freeze
|
||||||
|
@ -49,8 +50,10 @@ class DeployToken < ActiveRecord::Base
|
||||||
# to a single project, later we're going to extend
|
# to a single project, later we're going to extend
|
||||||
# that to be for multiple projects and namespaces.
|
# that to be for multiple projects and namespaces.
|
||||||
def project
|
def project
|
||||||
|
strong_memoize(:project) do
|
||||||
projects.first
|
projects.first
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def expires_at
|
def expires_at
|
||||||
expires_at = read_attribute(:expires_at)
|
expires_at = read_attribute(:expires_at)
|
||||||
|
|
Loading…
Reference in New Issue