summaryrefslogtreecommitdiff
path: root/app/services/notification_service.rb
diff options
context:
space:
mode:
authoradamliesko <adamliesko@gmail.com>2015-11-09 17:26:01 +0100
committeradamliesko <adamliesko@gmail.com>2015-11-09 17:26:01 +0100
commit798873ca75e656ed0fbd2a3080022eb55a6f3106 (patch)
tree722a2b82d8c3c7b68624f056df303b2a72332b62 /app/services/notification_service.rb
parent62769e2050efebec3beb1f1ddaa65d77e7182aaf (diff)
downloadgitlab-ce-798873ca75e656ed0fbd2a3080022eb55a6f3106.tar.gz
Add notification to the former assignee upon unassignment
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r--app/services/notification_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index a6b22348650..16c84f4a055 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -362,7 +362,8 @@ class NotificationService
def reassign_resource_email(target, project, current_user, method)
assignee_id_was = previous_record(target, "assignee_id")
- recipients = build_recipients(target, project, current_user)
+ previous_assignee = User.find(assignee_id_was)
+ recipients = build_recipients(target, project, current_user, [previous_assignee])
recipients.each do |recipient|
mailer.send(method, recipient.id, target.id, assignee_id_was, current_user.id)
@@ -377,8 +378,9 @@ class NotificationService
end
end
- def build_recipients(target, project, current_user)
+ def build_recipients(target, project, current_user, previous_records = nil )
recipients = target.participants(current_user)
+ recipients.concat(previous_records).compact.uniq if previous_records
recipients = add_project_watchers(recipients, project)
recipients = reject_mention_users(recipients, project)