Mercurial > hg > soundsoftware-site
comparison app/models/.svn/text-base/journal_observer.rb.svn-base @ 37:94944d00e43c
* Update to SVN trunk rev 4411
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 19 Nov 2010 13:24:41 +0000 |
parents | 513646585e45 |
children | cbce1fd3b1b7 |
comparison
equal
deleted
inserted
replaced
22:40f7cfd4df19 | 37:94944d00e43c |
---|---|
15 # along with this program; if not, write to the Free Software | 15 # along with this program; if not, write to the Free Software |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 |
18 class JournalObserver < ActiveRecord::Observer | 18 class JournalObserver < ActiveRecord::Observer |
19 def after_create(journal) | 19 def after_create(journal) |
20 Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated') | 20 if Setting.notified_events.include?('issue_updated') || |
21 (Setting.notified_events.include?('issue_note_added') && journal.notes.present?) || | |
22 (Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) || | |
23 (Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?) | |
24 Mailer.deliver_issue_edit(journal) | |
25 end | |
21 end | 26 end |
22 end | 27 end |