From ae93ba9309dd6fc95c37f2cbb3977632423c7f70 Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 17 Jun 2014 19:19:57 +0800 Subject: [PATCH] Fix is_preview --- app/controllers/admin/announcements_controller.rb | 2 +- app/controllers/announcements_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/announcements_controller.rb b/app/controllers/admin/announcements_controller.rb index f66fb73..ade9b8b 100644 --- a/app/controllers/admin/announcements_controller.rb +++ b/app/controllers/admin/announcements_controller.rb @@ -15,7 +15,7 @@ class Admin::AnnouncementsController < OrbitAdminController @filter_fields = filter_fields(@categories, @tags) @table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified] - @bulletins = Bulletin.where(:is_preview=>false).order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10) + @bulletins = Bulletin.where(:is_preview.in=>[false,nil]).order_by(sort).with_categories(filters("category")).with_tags(filters("tag")).with_status(filters("status")).page(params[:page]).per(10) if request.xhr? render :partial => "index" diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index e4bb168..5672f8b 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -1,7 +1,7 @@ class AnnouncementsController < ApplicationController def index - announcements = Bulletin.where(:is_preview=>false).can_display.order_by(:created_at=>'desc').filter_by_categories + announcements = Bulletin.where(:is_preview.in=>[false,nil]).can_display.order_by(:created_at=>'desc').filter_by_categories anns = announcements.collect do |a| statuses = a.statuses.collect do |status| { @@ -28,7 +28,7 @@ class AnnouncementsController < ApplicationController end def widget - announcements = Bulletin.where(:is_preview=>false).can_display.order_by(:created_at=>'desc').filter_by_widget_categories + announcements = Bulletin.where(:is_preview.in=>[false,nil]).can_display.order_by(:created_at=>'desc').filter_by_widget_categories anns = announcements.collect do |a| statuses = a.statuses.collect do |status| {