diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-19 11:35:13 -0700 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-19 11:35:13 -0700 |
commit | 03b54f1f0324c4d424d66e4bf36e42c2a88fc26d (patch) | |
tree | 6a76255a81d4a2a2abfecab568dd52a531337be6 /app/mailers/notify.rb | |
parent | 76dbafba86dda96b7ba2f93fc7e07eea3ca48302 (diff) | |
download | gitlab-ce-03b54f1f0324c4d424d66e4bf36e42c2a88fc26d.tar.gz |
Fix responding to commit notes
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r-- | app/mailers/notify.rb | 18 |
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 |