diff options
author | Robb Kidd <robb@thekidds.org> | 2012-05-15 18:50:36 -0400 |
---|---|---|
committer | Robb Kidd <robb@thekidds.org> | 2012-05-15 22:37:34 -0400 |
commit | 435fd8f0874450f2da480fa72b0f014d3f1fe271 (patch) | |
tree | 1854169640ea3ed143b53dae3f60739aa22a0c60 /app/mailers | |
parent | bb22360d1a7548facff3b72b2f9a0e66c6a55bb7 (diff) | |
download | gitlab-ce-435fd8f0874450f2da480fa72b0f014d3f1fe271.tar.gz |
Make Notify#note_issue_email resque friendly
Update method to take ids and then perform #finds itself during mailer
queue worker kick-off.
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/notify.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index dc6ef154aac..328825dfdab 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -43,14 +43,13 @@ class Notify < ActionMailer::Base mail(:to => recipient.email, :subject => "gitlab | note for merge request | #{@note.project.name} ") end - def note_issue_email(user, note) - @user = user - @note = Note.find(note['id']) - @project = @note.project + def note_issue_email(recipient_id, note_id) + recipient = User.find(recipient_id) + @note = Note.find(note_id) @issue = @note.noteable - mail(:to => @user['email'], :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ") + mail(:to => recipient.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ") end - + def new_merge_request_email(merge_request) @merge_request = MergeRequest.find(merge_request['id']) @user = @merge_request.assignee |