From 25919bef1ada9b73a388692ad41e422a2e9aecb7 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 19 May 2015 15:12:56 +0800 Subject: [PATCH] one more fix for empty title --- app/controllers/announcements_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index e264e97..d83bf6d 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -2,9 +2,9 @@ class AnnouncementsController < ApplicationController def index if !OrbitHelper.params['tags'].blank? - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_tags(OrbitHelper.params['tags']).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count) + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_tags(OrbitHelper.params['tags']).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count) else - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_categories.filter_by_tags + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_categories.filter_by_tags end anns = announcements.collect do |a| @@ -61,7 +61,7 @@ class AnnouncementsController < ApplicationController def widget tags = ["all"] if OrbitHelper.widget_tags.empty? - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_widget_categories.filter_by_tags(tags) + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_widget_categories.filter_by_tags(tags) page = Page.where(:module => "announcement").first rescue nil anns = announcements.collect do |a| statuses = a.statuses_with_classname.collect do |status|