Commit a10d09ec authored by Andreas Brandl's avatar Andreas Brandl

Fix N+1 query problem for users on members view.

For each member being rendered on
Projects::ProjectMembersController#index, there was a query to the users
table to retrieve the corresponding user:

```
SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1
```
parent 3eaf8778
......@@ -19,7 +19,7 @@ class MembersFinder
sql = distinct_on(union)
Member.from("(#{sql}) AS #{Member.table_name}")
Member.includes(:user).from("(#{sql}) AS #{Member.table_name}")
else
project_members
end
......
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