mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
grab highest post number from the raw data, so deletions at the end of a topic work
This commit is contained in:
@ -223,6 +223,15 @@ class TopicView
|
||||
@suggested_topics ||= TopicQuery.new(@user).list_suggested_for(topic)
|
||||
end
|
||||
|
||||
# This is pending a larger refactor, that allows custom orders
|
||||
# for now we need to look for the highest_post_number in the stream
|
||||
# the cache on topics is not correct if there are deleted posts at
|
||||
# the end of the stream (for mods), nor is it correct for filtered
|
||||
# streams
|
||||
def highest_post_number
|
||||
@highest_post_number ||= @posts.maximum(:post_number)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def read_posts_set
|
||||
|
Reference in New Issue
Block a user