diff options
Diffstat (limited to 'app/services/protected_branches')
-rw-r--r-- | app/services/protected_branches/api_create_service.rb | 10 | ||||
-rw-r--r-- | app/services/protected_branches/api_update_service.rb | 7 |
2 files changed, 4 insertions, 13 deletions
diff --git a/app/services/protected_branches/api_create_service.rb b/app/services/protected_branches/api_create_service.rb index d714a8aaf01..f2040dfa03a 100644 --- a/app/services/protected_branches/api_create_service.rb +++ b/app/services/protected_branches/api_create_service.rb @@ -4,22 +4,16 @@ # lives in this service. module ProtectedBranches class ApiCreateService < BaseService - def initialize(project, user, params) - @developers_can_merge = params.delete(:developers_can_merge) - @developers_can_push = params.delete(:developers_can_push) - super(project, user, params) - end - def execute push_access_level = - if @developers_can_push + if params.delete(:developers_can_push) Gitlab::Access::DEVELOPER else Gitlab::Access::MASTER end merge_access_level = - if @developers_can_merge + if params.delete(:developers_can_merge) Gitlab::Access::DEVELOPER else Gitlab::Access::MASTER diff --git a/app/services/protected_branches/api_update_service.rb b/app/services/protected_branches/api_update_service.rb index c28bffee2f4..050cb3b738b 100644 --- a/app/services/protected_branches/api_update_service.rb +++ b/app/services/protected_branches/api_update_service.rb @@ -4,13 +4,10 @@ # lives in this service. module ProtectedBranches class ApiUpdateService < BaseService - def initialize(project, user, params) - @developers_can_merge = params.delete(:developers_can_merge) + def execute(protected_branch) @developers_can_push = params.delete(:developers_can_push) - super(project, user, params) - end + @developers_can_merge = params.delete(:developers_can_merge) - def execute(protected_branch) @protected_branch = protected_branch protected_branch.transaction do |