From 1b227985dc8cbc60c455f9a5f712b7aa97a5ccdf Mon Sep 17 00:00:00 2001 From: nccu Date: Wed, 12 Nov 2014 18:26:22 +0800 Subject: [PATCH] update news homepage --- app/controllers/news_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 8d7ef3d..71bdc60 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -100,7 +100,7 @@ class NewsController < ApplicationController def widget params = OrbitHelper.params !params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"} - news = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_widget_categories.filter_by_tags(OrbitHelper.widget_tags) + news = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.order_by(:created_at=>'desc').filter_by_widget_categories.filter_by_tags(OrbitHelper.widget_tags) if news.nil? page = Page.where(:module => "news").first rescue nil ma = ModuleApp.find_by_key("news") rescue nil categories = ma.categories.enabled.collect do |cat|