From 3ea33aa84758ea65719467cf8a4b0c56605914e1 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 1 Apr 2015 13:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BAnews=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/forum.rb | 5 +++-- app/models/news.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/forum.rb b/app/models/forum.rb index 15d78ab24..199f4353d 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -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+ diff --git a/app/models/news.rb b/app/models/news.rb index 9b88209c4..8e944a018 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -103,7 +103,7 @@ class News < ActiveRecord::Base end 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