From 1d4ddef57568ac6c7beb912b9a12ddeeaad0a2fe Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 5 May 2016 16:32:43 +0800 Subject: [PATCH] small fix for tag filter --- app/controllers/announcements_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 70f0518..6b8fb50 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -19,7 +19,11 @@ class AnnouncementsController < ApplicationController end if (OrbitHelper.page_number == 1 or OrbitHelper.page_number.nil?) && !params["source"].present? - top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories([],false).to_a + if !params['tags'].blank? + top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories([],false).filter_by_tags(params['tags']).to_a + else + top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories([],false).filter_by_tags.to_a + end end if !feeds_anns.blank?