fix bugs.
This commit is contained in:
parent
6c4c1046bc
commit
f66c3d9c0c
|
@ -50,7 +50,7 @@ class Bulletin
|
||||||
|
|
||||||
validates_presence_of :title
|
validates_presence_of :title
|
||||||
|
|
||||||
before_save :set_key, :update_status
|
before_save :set_key, :update_status,:check_deadline
|
||||||
|
|
||||||
after_save :save_bulletin_links
|
after_save :save_bulletin_links
|
||||||
after_save :save_bulletin_files
|
after_save :save_bulletin_files
|
||||||
|
@ -159,6 +159,13 @@ class Bulletin
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def check_deadline
|
||||||
|
if(!self.deadline.nil? and (self.deadline<= self.postdate ))
|
||||||
|
self.deadline = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def set_key
|
def set_key
|
||||||
if title && title.new_record?
|
if title && title.new_record?
|
||||||
title.key = 'title'
|
title.key = 'title'
|
||||||
|
|
Reference in New Issue