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:
@@ -14,6 +14,7 @@ class PostRevisor
|
||||
@post.acting_user = @user
|
||||
revise_post
|
||||
update_category_description
|
||||
update_topic_excerpt
|
||||
post_process_post
|
||||
update_topic_word_counts
|
||||
@post.advance_draft_sequence
|
||||
@@ -107,6 +108,10 @@ class PostRevisor
|
||||
end
|
||||
end
|
||||
|
||||
def update_topic_excerpt
|
||||
@post.topic.update_column(:excerpt, @post.excerpt(220, strip_links: true)) if @post.post_number == 1
|
||||
end
|
||||
|
||||
def post_process_post
|
||||
@post.invalidate_oneboxes = true
|
||||
@post.trigger_post_process
|
||||
|
||||
Reference in New Issue
Block a user