grab highest post number from the raw data, so deletions at the end of a topic work

This commit is contained in:
Sam Saffron
2013-02-15 12:58:14 +11:00
parent 9eb5c2a66a
commit a8085f15c4
3 changed files with 19 additions and 4 deletions

View File

@ -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