From 2a6f623f3c205eb00c44cdb44e5855c91ccfc0a3 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 11 Apr 2016 19:27:28 +0800 Subject: [PATCH] added scope for index --- app/controllers/personal_certificates_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_certificates_controller.rb b/app/controllers/personal_certificates_controller.rb index 9c8de60..b6931f2 100644 --- a/app/controllers/personal_certificates_controller.rb +++ b/app/controllers/personal_certificates_controller.rb @@ -1,7 +1,7 @@ class PersonalCertificatesController < ApplicationController def index params = OrbitHelper.params - certificates = Certificate.where(:is_hidden=>false).order_by(:created_at=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) + certificates = Certificate.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) fields_to_show = Page.where(:page_id => params[:page_id]).first.custom_array_field rescue [] if fields_to_show.blank?