summaryrefslogtreecommitdiff
path: root/app/services/notification_recipients
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 09:08:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 09:08:28 +0000
commit6ac4a6713ed3196af899011f7e18658e16ebaac0 (patch)
treec60237cb5203d171481b765d31bfead080d063cf /app/services/notification_recipients
parentd2b64c37bdef067656fdc8deb4728a2fbc6c2729 (diff)
downloadgitlab-ce-6ac4a6713ed3196af899011f7e18658e16ebaac0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/notification_recipients')
-rw-r--r--app/services/notification_recipients/builder/base.rb7
-rw-r--r--app/services/notification_recipients/builder/new_note.rb4
2 files changed, 10 insertions, 1 deletions
diff --git a/app/services/notification_recipients/builder/base.rb b/app/services/notification_recipients/builder/base.rb
index 3aa00c09ba2..81e6750a4ca 100644
--- a/app/services/notification_recipients/builder/base.rb
+++ b/app/services/notification_recipients/builder/base.rb
@@ -23,6 +23,11 @@ module NotificationRecipients
raise 'abstract'
end
+ # override if needed
+ def recipients_target
+ target
+ end
+
def project
target.project
end
@@ -59,7 +64,7 @@ module NotificationRecipients
project: project,
group: group,
custom_action: custom_action,
- target: target,
+ target: recipients_target,
acting_user: acting_user
)
end
diff --git a/app/services/notification_recipients/builder/new_note.rb b/app/services/notification_recipients/builder/new_note.rb
index 27699a0d9cc..17e4728d352 100644
--- a/app/services/notification_recipients/builder/new_note.rb
+++ b/app/services/notification_recipients/builder/new_note.rb
@@ -12,6 +12,10 @@ module NotificationRecipients
note.noteable
end
+ def recipients_target
+ note
+ end
+
# NOTE: may be nil, in the case of a PersonalSnippet
#
# (this is okay because NotificationRecipient is written