|
|
@ -5,7 +5,7 @@ class Forum < ActiveRecord::Base
|
|
|
|
has_many :memos, :dependent => :destroy, conditions: "parent_id IS NULL"
|
|
|
|
has_many :memos, :dependent => :destroy, conditions: "parent_id IS NULL"
|
|
|
|
belongs_to :creator, :class_name => "User", :foreign_key => 'creator_id'
|
|
|
|
belongs_to :creator, :class_name => "User", :foreign_key => 'creator_id'
|
|
|
|
|
|
|
|
|
|
|
|
after_create :expire_forum_cache
|
|
|
|
after_create :expire_forum_cache, :send_email
|
|
|
|
after_update :expire_forum_cache
|
|
|
|
after_update :expire_forum_cache
|
|
|
|
before_destroy :expire_forum_cache
|
|
|
|
before_destroy :expire_forum_cache
|
|
|
|
safe_attributes 'name',
|
|
|
|
safe_attributes 'name',
|
|
|
@ -23,7 +23,7 @@ class Forum < ActiveRecord::Base
|
|
|
|
|
|
|
|
|
|
|
|
acts_as_taggable
|
|
|
|
acts_as_taggable
|
|
|
|
scope :by_join_date, order("created_at DESC")
|
|
|
|
scope :by_join_date, order("created_at DESC")
|
|
|
|
after_create :send_email
|
|
|
|
#after_create :send_email
|
|
|
|
def reset_counters!
|
|
|
|
def reset_counters!
|
|
|
|
self.class.reset_counters!(id)
|
|
|
|
self.class.reset_counters!(id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|