diff app/models/.svn/text-base/journal_observer.rb.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 94944d00e43c
children
line wrap: on
line diff
--- a/app/models/.svn/text-base/journal_observer.rb.svn-base	Thu Mar 03 11:42:28 2011 +0000
+++ b/app/models/.svn/text-base/journal_observer.rb.svn-base	Mon Jun 06 14:24:13 2011 +0100
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006-2007  Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2011  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -17,10 +17,12 @@
 
 class JournalObserver < ActiveRecord::Observer
   def after_create(journal)
-    if Setting.notified_events.include?('issue_updated') ||
-        (Setting.notified_events.include?('issue_note_added') && journal.notes.present?) ||
-        (Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) ||
-        (Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
+    if journal.notify? &&
+        (Setting.notified_events.include?('issue_updated') ||
+          (Setting.notified_events.include?('issue_note_added') && journal.notes.present?) ||
+          (Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) ||
+          (Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
+        )
       Mailer.deliver_issue_edit(journal)
     end
   end