mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
PERF: Remove N+1 queries on topic list page.
This commit is contained in:
parent
a1ea477604
commit
43f0884660
1 changed files with 2 additions and 1 deletions
|
@ -8,7 +8,8 @@ module TopicTagsMixin
|
||||||
end
|
end
|
||||||
|
|
||||||
def tags
|
def tags
|
||||||
topic.tags.pluck(:name)
|
# Calling method `pluck` along with `includes` causing N+1 queries
|
||||||
|
topic.tags.map(&:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def topic
|
def topic
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue