Commit d01153c4 authored by Valery Sizov's avatar Valery Sizov

Merge branch 'approvers_fixes' into 'master'

Approvals fixes



See merge request !452
parents 165a3cf3 e80bfcc5
......@@ -486,7 +486,7 @@ class MergeRequest < ActiveRecord::Base
def approver_ids=(value)
value.split(",").map(&:strip).each do |user_id|
approvers.find_or_create_by(user_id: user_id, target_id: id)
approvers.find_or_initialize_by(user_id: user_id, target_id: id)
end
end
end
......@@ -28,7 +28,7 @@
.col-sm-10
= f.number_field :approvals_before_merge, class: "form-control", min: 0
.help-block
How many users should approve merge request before it can be accepted. 0 - approval is disabled
Number of users to approve a merge request before it can be accepted. 0 - approving is disabled
.form-group.reset-approvals-on-push
.col-sm-offset-2.col-sm-10
......@@ -36,6 +36,7 @@
= f.label :reset_approvals_on_push do
= f.check_box :reset_approvals_on_push
%span.descr Reset approvals on push
.help-block Approvals are reset when new data is pushed to the merge request
.form-group
= f.label :approver_ids, class: 'control-label' do
......@@ -43,7 +44,7 @@
.col-sm-10
= users_select_tag("project[approver_ids]", multiple: true, class: 'input-large', scope: :all, email_user: true)
.help-block
Default approvers for each merge request.
Add an approver suggestion for each merge request
.panel.panel-default.prepend-top-10
.panel-heading
......
......@@ -90,7 +90,7 @@
.help-block
Merge Request should be approved by these users.
- if @project.approvers.any?
By default: #{render_items_list(@project.approvers.map{ |approver| approver.user.name})}.
Suggested approver(s): #{render_items_list(@project.approvers.map{ |approver| approver.user.name})}.
You can override the project settings by setting your own list of approvers.
.panel.panel-default.prepend-top-10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment