ee/app/controllers/ee/projects/merge_requests/application_controller.rb
# If the number of approvals is not greater than the project default, set to
# nil, so that we fall back to the project default. If it's not set, we can
# let the normal update logic handle this.
If the number of approvals is not greater than the project default, set to
nil, so that we fall back to the project default. If it's not set, we can
let the normal update logic handle this.
If the number of approvals is not greater than the project default set to nil so that we fall back to the project default . If it ' s not set we can let the normal update logic handle this .
def clamp_approvals_before_merge(mr_params)
          return mr_params unless mr_params[:approvals_before_merge]
          target_project = if @merge_request 
                             @merge_request.target_project 
                           elsif project.forked? && project.id.to_s != mr_params[:target_project_id]
                             project.forked_from_project
                           else
                             project
                           end
          if mr_params[:approvals_before_merge].to_i <= target_project.approvals_before_merge
            mr_params[:approvals_before_merge] = nil
          end
          mr_params
        end
def clamp_approvals_before_merge ( mr_params ) return mr_params unless mr_params [ :approvals_before_merge ] target_project = if @merge_request @merge_request . target_project elsif project . forked? && project . id . to_s != mr_params [ :target_project_id ] project . forked_from_project else project end if mr_params [ :approvals_before_merge ] . to_i <= target_project . approvals_before_merge mr_params [ :approvals_before_merge ] = nil end mr_params end
If the number of approvals is not greater than the project default, set to
nil, so that we fall back to the project default.
If the number of approvals is not greater than the project default set to nil so that we fall back to the project default .
# Target the MR target project in priority, else it depends whether the project # is forked. # rubocop:disable Gitlab/ModuleWithInstanceVariables # rubocop:disable Gitlab/ModuleWithInstanceVariables
mr_params
<not_specific>