diff --git a/app/controllers/forum_topics_controller.rb b/app/controllers/forum_topics_controller.rb index 5a14f0880..dc5e2c2cf 100644 --- a/app/controllers/forum_topics_controller.rb +++ b/app/controllers/forum_topics_controller.rb @@ -24,7 +24,7 @@ class ForumTopicsController < ApplicationController params[:search][:order] ||= "sticky" if request.format == Mime::Type.lookup("text/html") params[:limit] ||= 40 - @forum_topics = ForumTopic.active.paginated_search(params) + @forum_topics = ForumTopic.paginated_search(params) @forum_topics = @forum_topics.includes(:creator, :updater).load if request.format.html? @forum_topics = @forum_topics.includes(:creator, :original_post).load if request.format.atom? diff --git a/app/models/forum_post.rb b/app/models/forum_post.rb index 1f54f9149..0053468eb 100644 --- a/app/models/forum_post.rb +++ b/app/models/forum_post.rb @@ -65,6 +65,10 @@ 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 diff --git a/app/models/forum_topic.rb b/app/models/forum_topic.rb index 9dd280be3..a96ff4a5e 100644 --- a/app/models/forum_topic.rb +++ b/app/models/forum_topic.rb @@ -80,6 +80,10 @@ class ForumTopic < ApplicationRecord q = q.apply_default_order(params) end + unless params[:is_deleted].present? + q = q.active + end + q end end