PERF: Avoid tags N+1 in assigned topic lists
This commit is contained in:
parent
6dbf3e2bcb
commit
8a77c932a7
|
@ -217,6 +217,7 @@ after_initialize do
|
||||||
WHERE name = 'assigned_to_id'
|
WHERE name = 'assigned_to_id'
|
||||||
AND value = ?)
|
AND value = ?)
|
||||||
", user.id.to_s)
|
", user.id.to_s)
|
||||||
|
.includes(:tags)
|
||||||
|
|
||||||
list = apply_ordering(list, options)
|
list = apply_ordering(list, options)
|
||||||
|
|
||||||
|
@ -257,6 +258,7 @@ after_initialize do
|
||||||
WHERE name = 'assigned_to_id'
|
WHERE name = 'assigned_to_id'
|
||||||
AND value IN (SELECT user_id::varchar(255) from group_users where group_id = ?))
|
AND value IN (SELECT user_id::varchar(255) from group_users where group_id = ?))
|
||||||
", group.id.to_s)
|
", group.id.to_s)
|
||||||
|
.includes(:tags)
|
||||||
|
|
||||||
list = apply_ordering(list, options)
|
list = apply_ordering(list, options)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue