added scope for index

This commit is contained in:
Harry Bomrah 2016-04-11 19:23:19 +08:00
parent 04369d0531
commit d69fbd6734
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
class PersonalProjectsController < ApplicationController
def index
params = OrbitHelper.params
projects = Project.where(:is_hidden=>false).order_by(:period_start_date=>'desc',:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
projects = Project.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?
fields_to_show = [