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|