From 4aa7ba620ed70e445ec7a4b15b7e7e0ed287b348 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Fri, 15 Feb 2013 13:08:17 +1100 Subject: [PATCH] fix, so really long topics are correct, tested perf on a 4k post topic and seems fine --- lib/topic_view.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/topic_view.rb b/lib/topic_view.rb index fb84a680a77..5ccbd398dd7 100644 --- a/lib/topic_view.rb +++ b/lib/topic_view.rb @@ -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