Commit 0cedd703 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Prevent a lot of sql queries for ProjectTeam#fetch_members method

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ec8d3989
...@@ -144,7 +144,10 @@ class ProjectTeam ...@@ -144,7 +144,10 @@ class ProjectTeam
group_members = group_members.send(level) if group group_members = group_members.send(level) if group
end 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 end
def group def group
......
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