From 3955c3fc8d65b5b94092c88ea996e7607a9aae5e Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 8 Oct 2019 00:00:16 -0500 Subject: [PATCH] /forum_topics: fix default limit being ignored. --- app/controllers/forum_topics_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/forum_topics_controller.rb b/app/controllers/forum_topics_controller.rb index 076eef5a9..75ef9c583 100644 --- a/app/controllers/forum_topics_controller.rb +++ b/app/controllers/forum_topics_controller.rb @@ -22,6 +22,7 @@ class ForumTopicsController < ApplicationController def index params[:search] ||= {} params[:search][:order] ||= "sticky" if request.format == Mime::Type.lookup("text/html") + params[:limit] ||= 40 @forum_topics = ForumTopic.active.paginated_search(params) @forum_topics = @forum_topics.includes(:creator, :updater).load if request.format.html? @@ -99,10 +100,6 @@ class ForumTopicsController < ApplicationController end private - def per_page - params[:limit] || 40 - end - def normalize_search if params[:title_matches] params[:search] ||= {}