fix slow pagination

This commit is contained in:
manson 2014-05-21 15:54:47 +08:00
parent 8501592f1c
commit b11f537a67
1 changed files with 1 additions and 3 deletions

View File

@ -14,9 +14,7 @@ class Admin::AnnouncementsController < OrbitAdminController
@filter_fields = filter_fields(@categories, @tags)
@table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified]
@bulletins = Kaminari.paginate_array(
Bulletin.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status"))
).page(params[:page]).per(10)
@bulletins = Bulletin.order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10)
if request.xhr?
render :partial => "index"