fix, so really long topics are correct, tested perf on a 4k post topic and seems fine

This commit is contained in:
Sam Saffron 2013-02-15 13:08:17 +11:00
parent a8085f15c4
commit 4aa7ba620e

View file

@ -31,6 +31,8 @@ class TopicView
@user = user
@initial_load = true
@all_posts = @posts
filter_posts(options)
@draft_key = @topic.draft_key
@ -229,7 +231,7 @@ class TopicView
# 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)
@highest_post_number ||= @all_posts.maximum(:post_number)
end
protected