From 995efe428ba16f79b24aa976aa85c8642f1f0942 Mon Sep 17 00:00:00 2001 From: manson Date: Wed, 21 May 2014 15:56:53 +0800 Subject: [PATCH] fix slow pagination --- app/controllers/admin/archive_files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 1fa8d50..c1994e3 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -13,7 +13,7 @@ class Admin::ArchiveFilesController < OrbitAdminController categories = params[:filters][:category].blank? ? [] : params[:filters][:category] rescue [] tags = params[:filters][:tags].blank? ? [] : params[:filters][:tags] rescue [] - @archives = Kaminari.paginate_array(ArchiveFile.order_by(sort).with_categories(categories).with_tags(tags).with_status(status)).page(params[:page]).per(10) + @archives = ArchiveFile.order_by(sort).with_categories(categories).with_tags(tags).with_status(status).page(params[:page]).per(10) if request.xhr? render :partial => "index"