2014-10-23 11:30:34 +08:00
|
|
|
class ContestNotification < ActiveRecord::Base
|
|
|
|
attr_accessible :content, :title
|
|
|
|
validates :title, length: {maximum: 30}
|
2015-01-07 09:27:44 +08:00
|
|
|
after_create :expire_cache
|
|
|
|
after_update :expire_cache
|
|
|
|
before_destroy :expire_cache
|
|
|
|
|
|
|
|
def expire_cache
|
|
|
|
ActionController::Base.new.expire_fragment('forums')
|
|
|
|
end
|
2014-10-23 11:30:34 +08:00
|
|
|
end
|