Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-07-08 10:30:38 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-07-29 12:50:39 +0300
commit12387b4d2c6abbe1de2fc6b0776207d9135c29f0 (patch)
treed8966a8f149e75e24842b4ae85ba7e7c048e0ce0 /app/models/protected_branch.rb
parent828f6eb6e50e6193fad9dbdd95d9dd56506e4064 (diff)
Allow setting "Allowed To Push/Merge" while creating a protected branch.
1. Reuse the same dropdown component that we used for updating these settings (`ProtectedBranchesAccessSelect`). Have it accept options for the parent container (so we can control the elements it sees) and whether or not to save changes via AJAX (we need this for update, but not create). 2. Change the "Developers" option to "Developers + Masters", which is clearer. 3. Remove `developers_can_push` and `developers_can_merge` from the model, since they're not needed anymore.
Diffstat (limited to 'app/models/protected_branch.rb')
-rw-r--r--app/models/protected_branch.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index b0fde6c6c1b..c0bee72b4d7 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -12,12 +12,12 @@ class ProtectedBranch < ActiveRecord::Base
project.commit(self.name)
end
- def developers_can_push
- self.push_access_level && self.push_access_level.developers?
+ def allowed_to_push
+ self.push_access_level && self.push_access_level.access_level
end
- def developers_can_merge
- self.merge_access_level && self.merge_access_level.developers?
+ def allowed_to_merge
+ self.merge_access_level && self.merge_access_level.access_level
end
# Returns all protected branches that match the given branch name.