Prevent a lot of sql queries for ProjectTeam#fetch_members method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
ec8d39897c
commit
0cedd7039a
1 changed files with 4 additions and 1 deletions
|
@ -144,7 +144,10 @@ class ProjectTeam
|
|||
group_members = group_members.send(level) if group
|
||||
end
|
||||
|
||||
(project_members + group_members).map(&:user).uniq
|
||||
user_ids = project_members.pluck(:user_id)
|
||||
user_ids += group_members.pluck(:user_id) if group
|
||||
|
||||
User.where(id: user_ids)
|
||||
end
|
||||
|
||||
def group
|
||||
|
|
Loading…
Reference in a new issue