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
72c9b8a9
Commit
72c9b8a9
authored
Jan 02, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor approver query
Utilze the new group_users association
parent
2c1c67a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
ee/app/models/concerns/approval_rule_like.rb
ee/app/models/concerns/approval_rule_like.rb
+1
-9
No files found.
ee/app/models/concerns/approval_rule_like.rb
View file @
72c9b8a9
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
ApprovalRuleLike
module
ApprovalRuleLike
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
include
Gitlab
::
Utils
::
StrongMemoize
DEFAULT_NAME
=
'Default'
DEFAULT_NAME
=
'Default'
...
@@ -17,14 +16,7 @@ module ApprovalRuleLike
...
@@ -17,14 +16,7 @@ module ApprovalRuleLike
# Users who are eligible to approve, including specified group members.
# Users who are eligible to approve, including specified group members.
# @return [Array<User>]
# @return [Array<User>]
def
approvers
def
approvers
strong_memoize
(
:approvers
)
do
@approvers
||=
User
.
from_union
([
users
,
group_users
])
User
.
from_union
(
[
users
,
User
.
joins
(
:group_members
).
where
(
members:
{
source_id:
groups
})
]
)
end
end
end
def
add_member
(
member
)
def
add_member
(
member
)
...
...
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