mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 23:28:29 +08:00
PERF: Remove N+1 queries on topic list page.
This commit is contained in:
parent
a1ea477604
commit
43f0884660
|
@ -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…
Reference in New Issue
Block a user