diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-08 13:00:38 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 15:20:39 +0530 |
commit | 12387b4d2c6abbe1de2fc6b0776207d9135c29f0 (patch) | |
tree | d8966a8f149e75e24842b4ae85ba7e7c048e0ce0 /app/models | |
parent | 828f6eb6e50e6193fad9dbdd95d9dd56506e4064 (diff) | |
download | gitlab-ce-12387b4d2c6abbe1de2fc6b0776207d9135c29f0.tar.gz |
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')
-rw-r--r-- | app/models/protected_branch.rb | 8 |
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. |