fix slow pagination
This commit is contained in:
		
							parent
							
								
									9c98bca6dd
								
							
						
					
					
						commit
						995efe428b
					
				| 
						 | 
					@ -13,7 +13,7 @@ class Admin::ArchiveFilesController < OrbitAdminController
 | 
				
			||||||
    categories = params[:filters][:category].blank? ? [] : params[:filters][:category] rescue []
 | 
					    categories = params[:filters][:category].blank? ? [] : params[:filters][:category] rescue []
 | 
				
			||||||
    tags = params[:filters][:tags].blank? ? [] : params[:filters][:tags] 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?
 | 
					    if request.xhr?
 | 
				
			||||||
      render :partial => "index"
 | 
					      render :partial => "index"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue