新建news报500

dev_repository_hjq
guange 11 years ago
parent b23892e29e
commit 3ea33aa847

@ -20,7 +20,7 @@ class Forum < ActiveRecord::Base
after_destroy :delete_kindeditor_assets after_destroy :delete_kindeditor_assets
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_mail
def reset_counters! def reset_counters!
self.class.reset_counters!(id) self.class.reset_counters!(id)
end end
@ -35,7 +35,8 @@ class Forum < ActiveRecord::Base
self.creator == user || user.admin? self.creator == user || user.admin?
end 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') Mailer.run.forum_add(self) if Setting.notified_events.include?('forum_add')
end end
# Updates topic_count, memo_count and last_memo_id attributes for +board_id+ # Updates topic_count, memo_count and last_memo_id attributes for +board_id+

@ -103,7 +103,7 @@ class News < ActiveRecord::Base
end end
def send_mail def send_mail
Mailer.run.news_added(news) if Setting.notified_events.include?('news_added') Mailer.run.news_added(self) if Setting.notified_events.include?('news_added')
end end
end end

Loading…
Cancel
Save