summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-08-19 11:35:13 -0700
committerDouwe Maan <douwe@gitlab.com>2015-08-19 11:35:13 -0700
commit03b54f1f0324c4d424d66e4bf36e42c2a88fc26d (patch)
tree6a76255a81d4a2a2abfecab568dd52a531337be6 /app
parent76dbafba86dda96b7ba2f93fc7e07eea3ca48302 (diff)
downloadgitlab-ce-03b54f1f0324c4d424d66e4bf36e42c2a88fc26d.tar.gz
Fix responding to commit notes
Diffstat (limited to 'app')
-rw-r--r--app/mailers/notify.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 8a386de9a39..b4c83f8c5fc 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -49,11 +49,21 @@ class Notify < ActionMailer::Base
def sent_notification!(noteable, recipient_id)
return unless reply_key
+ noteable_id = nil
+ commit_id = nil
+ if noteable.is_a?(Commit)
+ commit_id = noteable.id
+ else
+ noteable_id = noteable.id
+ end
+
SentNotification.create(
- project: noteable.project,
- noteable: noteable,
- recipient_id: recipient_id,
- reply_key: reply_key
+ project: noteable.project,
+ noteable_type: noteable.class.name,
+ noteable_id: noteable_id,
+ commit_id: commit_id,
+ recipient_id: recipient_id,
+ reply_key: reply_key
)
end