fix for tags
This commit is contained in:
parent
7b0008c03a
commit
5ecd24c977
|
@ -101,7 +101,7 @@ class AnnouncementsController < ApplicationController
|
||||||
|
|
||||||
def random_announcement_widget
|
def random_announcement_widget
|
||||||
uid = OrbitHelper.params[:uid] rescue ""
|
uid = OrbitHelper.params[:uid] rescue ""
|
||||||
tags = ["all"] if OrbitHelper.widget_tags.empty?
|
tags = OrbitHelper.widget_tags
|
||||||
categories = OrbitHelper.widget_categories || []
|
categories = OrbitHelper.widget_categories || []
|
||||||
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:uid.ne => uid, :category_id.in => categories).and(:title.ne => nil).can_display.is_approved.filter_by_tags(tags).sample(OrbitHelper.widget_data_count)
|
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:uid.ne => uid, :category_id.in => categories).and(:title.ne => nil).can_display.is_approved.filter_by_tags(tags).sample(OrbitHelper.widget_data_count)
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class AnnouncementsController < ApplicationController
|
||||||
|
|
||||||
def widget
|
def widget
|
||||||
uid = OrbitHelper.params[:uid] rescue ""
|
uid = OrbitHelper.params[:uid] rescue ""
|
||||||
tags = ["all"] if OrbitHelper.widget_tags.empty?
|
tags = OrbitHelper.widget_tags
|
||||||
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:uid.ne => uid).and(:title.ne => nil).can_display.is_approved.filter_by_widget_categories.filter_by_tags(tags)
|
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil],:uid.ne => uid).and(:title.ne => nil).can_display.is_approved.filter_by_widget_categories.filter_by_tags(tags)
|
||||||
|
|
||||||
pack_data(announcements)
|
pack_data(announcements)
|
||||||
|
|
Loading…
Reference in New Issue