From e0ec9ed5185454618560ba916f4e825471d9bfc5 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 1 Feb 2018 16:35:47 -0800 Subject: [PATCH] fix ordering of forum posts in topics --- app/controllers/forum_topics_controller.rb | 2 +- app/controllers/ip_bans_controller.rb | 2 +- app/controllers/janitor_trials_controller.rb | 2 +- app/controllers/pools_controller.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/forum_topics_controller.rb b/app/controllers/forum_topics_controller.rb index 0329363ac..9f40958b8 100644 --- a/app/controllers/forum_topics_controller.rb +++ b/app/controllers/forum_topics_controller.rb @@ -45,7 +45,7 @@ class ForumTopicsController < ApplicationController if request.format == Mime::HTML @forum_topic.mark_as_read!(CurrentUser.user) end - @forum_posts = ForumPost.search(:topic_id => @forum_topic.id).order("forum_posts.id").paginate(params[:page]) + @forum_posts = ForumPost.search(:topic_id => @forum_topic.id).reorder("forum_posts.id").paginate(params[:page]) respond_with(@forum_topic) do |format| format.atom do @forum_posts = @forum_posts.reverse_order.includes(:creator).load diff --git a/app/controllers/ip_bans_controller.rb b/app/controllers/ip_bans_controller.rb index 0eccf5229..e7687e99e 100644 --- a/app/controllers/ip_bans_controller.rb +++ b/app/controllers/ip_bans_controller.rb @@ -13,7 +13,7 @@ class IpBansController < ApplicationController def index @search = IpBan.search(params[:search]) - @ip_bans = @search.order("id desc").paginate(params[:page], :limit => params[:limit]) + @ip_bans = @search.paginate(params[:page], :limit => params[:limit]) respond_with(@ip_bans) end diff --git a/app/controllers/janitor_trials_controller.rb b/app/controllers/janitor_trials_controller.rb index 21fa74fd0..49c7f8db1 100644 --- a/app/controllers/janitor_trials_controller.rb +++ b/app/controllers/janitor_trials_controller.rb @@ -14,7 +14,7 @@ class JanitorTrialsController < ApplicationController def index @search = JanitorTrial.search(params[:search]) - @janitor_trials = @search.order("id desc").paginate(params[:page], :limit => params[:limit]) + @janitor_trials = @search.paginate(params[:page], :limit => params[:limit]) respond_with(@janitor_trials) end diff --git a/app/controllers/pools_controller.rb b/app/controllers/pools_controller.rb index 8ae7e3365..7d7ced9c0 100644 --- a/app/controllers/pools_controller.rb +++ b/app/controllers/pools_controller.rb @@ -27,7 +27,7 @@ class PoolsController < ApplicationController def gallery limit = params[:limit] || CurrentUser.user.per_page - @pools = Pool.series.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => limit, :search_count => params[:search]) + @pools = Pool.series.search(params[:search]).reorder("updated_at desc").paginate(params[:page], :limit => limit, :search_count => params[:search]) @post_set = PostSets::PoolGallery.new(@pools) end