summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-04-04 18:43:41 -0500
committerMayra Cabrera <mcabrera@gitlab.com>2018-04-06 21:20:16 -0500
commit171b2625b128e5954ce0a150a4fc923a22164e4e (patch)
tree834586c27477a404e71fe2fac9d17ecf3e495e58 /app/models
parent7deab3172257bef7818ce834c1e0709432ddd5e0 (diff)
downloadgitlab-ce-171b2625b128e5954ce0a150a4fc923a22164e4e.tar.gz
Addreses backend review suggestions
- Remove extra method for authorize_admin_project - Ensure project presence - Rename 'read_repo' to 'read_repository' to be more verbose
Diffstat (limited to 'app/models')
-rw-r--r--app/models/deploy_token.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb
index 475ad06906a..b4df44d295a 100644
--- a/app/models/deploy_token.rb
+++ b/app/models/deploy_token.rb
@@ -3,11 +3,12 @@ class DeployToken < ActiveRecord::Base
include TokenAuthenticatable
add_authentication_token_field :token
- AVAILABLE_SCOPES = %w(read_repo read_registry).freeze
+ AVAILABLE_SCOPES = %w(read_repository read_registry).freeze
serialize :scopes, Array # rubocop:disable Cop/ActiveRecordSerialize
validates :scopes, presence: true
+ validates :project, presence: true
belongs_to :project