|
|
|
@ -20,7 +20,7 @@ class Forum < ActiveRecord::Base
|
|
|
|
|
after_destroy :delete_kindeditor_assets
|
|
|
|
|
acts_as_taggable
|
|
|
|
|
scope :by_join_date, order("created_at DESC")
|
|
|
|
|
after_create :send_email
|
|
|
|
|
after_create :send_mail
|
|
|
|
|
def reset_counters!
|
|
|
|
|
self.class.reset_counters!(id)
|
|
|
|
|
end
|
|
|
|
@ -35,7 +35,8 @@ class Forum < ActiveRecord::Base
|
|
|
|
|
self.creator == user || user.admin?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def send_email
|
|
|
|
|
def send_mail
|
|
|
|
|
logger.debug "send mail for forum add."
|
|
|
|
|
Mailer.run.forum_add(self) if Setting.notified_events.include?('forum_add')
|
|
|
|
|
end
|
|
|
|
|
# Updates topic_count, memo_count and last_memo_id attributes for +board_id+
|
|
|
|
|