summaryrefslogtreecommitdiff
path: root/app/mailers/notify.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/notify.rb')
-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