Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2b538728
Commit
2b538728
authored
Sep 25, 2019
by
Igor
Committed by
Stan Hu
Sep 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide All members rule from approvers list
parent
ea6aa216
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
ee/app/models/approval_merge_request_rule.rb
ee/app/models/approval_merge_request_rule.rb
+1
-1
ee/app/models/concerns/deprecated_approvals_before_merge.rb
ee/app/models/concerns/deprecated_approvals_before_merge.rb
+2
-2
ee/spec/models/approval_merge_request_rule_spec.rb
ee/spec/models/approval_merge_request_rule_spec.rb
+7
-0
No files found.
ee/app/models/approval_merge_request_rule.rb
View file @
2b538728
...
...
@@ -78,7 +78,7 @@ class ApprovalMergeRequestRule < ApplicationRecord
# Temporary override to handle legacy records that have not yet been migrated
# To be removed with https://gitlab.com/gitlab-org/gitlab/issues/11834
def
regular?
read_attribute
(
:rule_type
)
==
'regular'
||
(
!
report_approver?
&&
!
code_owner
)
read_attribute
(
:rule_type
)
==
'regular'
||
(
!
report_approver?
&&
!
code_owner
&&
!
any_approver?
)
end
alias_method
:regular
,
:regular?
...
...
ee/app/models/concerns/deprecated_approvals_before_merge.rb
View file @
2b538728
...
...
@@ -8,9 +8,9 @@ module DeprecatedApprovalsBeforeMerge
included
do
after_save
do
next
unless
saved_changes
[
'approvals_before_merge'
]
run_after_commit
do
next
unless
saved_changes
[
'approvals_before_merge'
]
update_any_approver_rule
end
end
...
...
ee/spec/models/approval_merge_request_rule_spec.rb
View file @
2b538728
...
...
@@ -191,6 +191,13 @@ describe ApprovalMergeRequestRule do
expect
(
subject
.
regular
).
to
eq
(
false
)
expect
(
subject
.
regular?
).
to
eq
(
false
)
end
it
'returns false for any approver records'
do
subject
=
create
(
:approval_merge_request_rule
,
merge_request:
merge_request
,
rule_type: :any_approver
)
expect
(
subject
.
regular
).
to
eq
(
false
)
expect
(
subject
.
regular?
).
to
eq
(
false
)
end
end
describe
'#code_owner?'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment