Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
961d43a9
Commit
961d43a9
authored
Sep 27, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memorize project to avoid re-query
[skip ci]
parent
9f7d75fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
app/models/deploy_token.rb
app/models/deploy_token.rb
+4
-1
No files found.
app/models/deploy_token.rb
View file @
961d43a9
...
...
@@ -4,6 +4,7 @@ class DeployToken < ActiveRecord::Base
include
Expirable
include
TokenAuthenticatable
include
PolicyActor
include
Gitlab
::
Utils
::
StrongMemoize
add_authentication_token_field
:token
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
# that to be for multiple projects and namespaces.
def
project
strong_memoize
(
:project
)
do
projects
.
first
end
end
def
expires_at
expires_at
=
read_attribute
(
:expires_at
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment