mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add excerpt column to topics table to remove N+1 query in ListableTopicSerializer
This commit is contained in:
@@ -64,11 +64,6 @@ class ListableTopicSerializer < BasicTopicSerializer
|
||||
pinned
|
||||
end
|
||||
|
||||
def excerpt
|
||||
# excerpt should be hoisted into topic, this is an N+1 query ... yuck
|
||||
object.posts.by_post_number.first.try(:excerpt, 220, strip_links: true) || nil
|
||||
end
|
||||
|
||||
def pinned
|
||||
PinnedCheck.new(object, object.user_data).pinned?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user