From 06366b53794044a10b069cc20cacfd1a1024f724 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Mon, 20 Mar 2017 18:30:49 +0200 Subject: [PATCH] latest.json: last topic from first page appears on the second page as well. --- lib/topic_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/topic_query.rb b/lib/topic_query.rb index 62e6ec619b9..51deb6654fa 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -315,7 +315,7 @@ class TopicQuery if page == 0 (pinned_topics + unpinned_topics)[0...limit] if limit else - offset = (page * per_page) - pinned_topics.count - 1 + offset = (page * per_page) - pinned_topics.count offset = 0 unless offset > 0 unpinned_topics.offset(offset).to_a end