PERF: Avoid tags N+1 in assigned topic lists

PERF: Avoid tags N+1 in assigned topic lists

diff --git a/plugin.rb b/plugin.rb
index 7ff7004..808b439 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -217,6 +217,7 @@ after_initialize do
         WHERE name = 'assigned_to_id'
         AND value = ?)
     ", user.id.to_s)
+      .includes(:tags)
 
     list = apply_ordering(list, options)
 
@@ -257,6 +258,7 @@ after_initialize do
         WHERE name = 'assigned_to_id'
         AND value IN (SELECT user_id::varchar(255) from group_users where group_id = ?))
     ", group.id.to_s)
+      .includes(:tags)
 
     list = apply_ordering(list, options)
 

GitHub sha: 8a77c932

1 Like

This commit appears in #90 which was merged by davidtaylorhq.