one more fix for empty title
This commit is contained in:
parent
5b88d8373c
commit
25919bef1a
|
@ -2,9 +2,9 @@ class AnnouncementsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if !OrbitHelper.params['tags'].blank?
|
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
|
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
|
end
|
||||||
|
|
||||||
anns = announcements.collect do |a|
|
anns = announcements.collect do |a|
|
||||||
|
@ -61,7 +61,7 @@ class AnnouncementsController < ApplicationController
|
||||||
|
|
||||||
def widget
|
def widget
|
||||||
tags = ["all"] if OrbitHelper.widget_tags.empty?
|
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
|
page = Page.where(:module => "announcement").first rescue nil
|
||||||
anns = announcements.collect do |a|
|
anns = announcements.collect do |a|
|
||||||
statuses = a.statuses_with_classname.collect do |status|
|
statuses = a.statuses_with_classname.collect do |status|
|
||||||
|
|
Loading…
Reference in New Issue