From 47d95e8d8058574df9f139cdba84a953b499dc93 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 7 Jan 2020 00:18:16 -0600 Subject: [PATCH] forum: fix last page links leading to empty page. Bug: on the forum index, clicking on 'page 290' of the Danbooru 2 Issues thread leads to an empty page. The last page is actually page 288. Cause: 89df0a6ac changed it so that deleted posts are filtered out of threads, but this made the calculation of the last page incorrect. The last page is calculated from the topic's response_count, but the response count includes deleted posts. --- app/models/forum_post.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/models/forum_post.rb b/app/models/forum_post.rb index 074d465b2..6c797731b 100644 --- a/app/models/forum_post.rb +++ b/app/models/forum_post.rb @@ -65,10 +65,6 @@ class ForumPost < ApplicationRecord q = q.joins(:topic).where("forum_topics.category_id = ?", params[:topic_category_id].to_i) end - unless params[:is_deleted].present? - q = q.active - end - q.apply_default_order(params) end end