diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index a4a7614d4..c7ad2a063 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -914,6 +914,14 @@ class Issue < ActiveRecord::Base end end + def notify? + @notify != false + end + + def notify=(arg) + @notify = arg + end + # Returns the number of hours spent on this issue def spent_hours @spent_hours ||= time_entries.sum(:hours) || 0 @@ -1625,7 +1633,7 @@ class Issue < ActiveRecord::Base end def send_notification - if Setting.notified_events.include?('issue_added') + if notify? && Setting.notified_events.include?('issue_added') Mailer.deliver_issue_add(self) end end |