From 47c8900a5df31fea17c9c1f0aba5a9e1c501fc6e Mon Sep 17 00:00:00 2001 From: nccu Date: Thu, 12 Mar 2015 17:53:07 +0800 Subject: [PATCH] is preview fixed --- app/models/bulletin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index 81745cb..ed37674 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -51,7 +51,7 @@ class Bulletin # before_save :fetch_dept - scope :can_display, ->{where(:is_hidden=>false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:is_top, :desc])} + scope :can_display, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:is_top, :desc])} scope :is_approved, ->{where(:approved => true)} def update_user