diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-25 14:42:52 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 15:20:39 +0530 |
commit | 7b2ad2d5b99d84fc2d2c11a654085afc02a05bb1 (patch) | |
tree | 3ee132c1ad1187e0905f08b6f360a18bd8a1519f /app/services | |
parent | b3a29b3180c4edda33d82fc3564bd4991831e06c (diff) | |
download | gitlab-ce-7b2ad2d5b99d84fc2d2c11a654085afc02a05bb1.tar.gz |
Implement review comments from @dbalexandre.
1. Remove `master_or_greater?` and `developer_or_greater?` in favor of
`max_member_access`, which is a lot nicer.
2. Remove a number of instances of `include Gitlab::Database::MigrationHelpers`
in migrations that don't need this module. Also remove comments where
not necessary.
3. Remove duplicate entry in CHANGELOG.
4. Move `ProtectedBranchAccessSelect` from Coffeescript to ES6.
5. Split the `set_access_levels!` method in two - one each for `merge` and
`push` access levels.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/protected_branches/base_service.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/services/protected_branches/base_service.rb b/app/services/protected_branches/base_service.rb index 3a7c35327fe..f8741fcb3d5 100644 --- a/app/services/protected_branches/base_service.rb +++ b/app/services/protected_branches/base_service.rb @@ -1,13 +1,22 @@ module ProtectedBranches class BaseService < ::BaseService def set_access_levels! + set_merge_access_levels! + set_push_access_levels! + end + + protected + + def set_merge_access_levels! case params[:allowed_to_merge] when 'masters' @protected_branch.merge_access_level.masters! when 'developers' @protected_branch.merge_access_level.developers! end + end + def set_push_access_levels! case params[:allowed_to_push] when 'masters' @protected_branch.push_access_level.masters! |