fix unit
This commit is contained in:
parent
47c8900a5d
commit
d8a49dfdfa
|
@ -49,7 +49,7 @@ class Bulletin
|
|||
return true
|
||||
end
|
||||
|
||||
# before_save :fetch_dept
|
||||
before_save :fetch_dept
|
||||
|
||||
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)}
|
||||
|
@ -107,7 +107,7 @@ class Bulletin
|
|||
protected
|
||||
|
||||
def fetch_dept
|
||||
refetch_dept if self.new_record?
|
||||
refetch_dept if self.new_record? && !self.is_preview
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Reference in New Issue