Commit 621c6b8533b527c735bb90c0a49ed18f55af93fa

Authored by Riyad Preukschas
1 parent 7335f366

Fix commit note notification

app/mailers/notify.rb
... ... @@ -62,12 +62,12 @@ class Notify < ActionMailer::Base
62 62 # Note
63 63 #
64 64  
65   - def note_commit_email(recipient_id, note_id)
  65 + def note_commit_email(commit_autor_email, note_id)
66 66 @note = Note.find(note_id)
67 67 @commit = @note.noteable
68 68 @commit = CommitDecorator.decorate(@commit)
69 69 @project = @note.project
70   - mail(to: recipient(recipient_id), subject: subject("note for commit #{@commit.short_id}", @commit.title))
  70 + mail(to: recipient(commit_autor_email), subject: subject("note for commit #{@commit.short_id}", @commit.title))
71 71 end
72 72  
73 73 def note_issue_email(recipient_id, note_id)
... ...
app/observers/note_observer.rb
... ... @@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer
11 11 notify_team(note)
12 12 elsif note.notify_author
13 13 # Notify only author of resource
14   - Notify.note_commit_email(note.commit_author.id, note.id).deliver
  14 + Notify.note_commit_email(note.noteable.author_email, note.id).deliver
15 15 else
16 16 # Otherwise ignore it
17 17 nil
... ...