diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 026ce1211..972bf0135 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -143,6 +143,15 @@ class Issue < ActiveRecord::Base project.assignable_users end + # Returns the mail adresses of users that should be notified for the issue + def recipients + recipients = project.recipients + # Author and assignee are always notified + recipients << author.mail if author + recipients << assigned_to.mail if assigned_to + recipients.compact.uniq + end + def spent_hours @spent_hours ||= time_entries.sum(:hours) || 0 end |