summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorRobb Kidd <robb@thekidds.org>2012-05-15 19:20:15 -0400
committerRobb Kidd <robb@thekidds.org>2012-05-15 22:37:34 -0400
commit0a9a2c2a0b75ba617611382b6335bf2b7fc68b9f (patch)
treebcc7bf2a73b7758b1d20dccdb8b2759fbda5cd1f /app/mailers
parent435fd8f0874450f2da480fa72b0f014d3f1fe271 (diff)
downloadgitlab-ce-0a9a2c2a0b75ba617611382b6335bf2b7fc68b9f.tar.gz
Make Notify#note_commit_email resque friendly
Update method to take ids and then perform #finds itself during mailer queue worker kick-off. Also, the faux SHA1 cannot have underscores or it will not match the commit pattern defined in the routes.
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/notify.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 328825dfdab..1fa1a2b8ebc 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -28,12 +28,11 @@ class Notify < ActionMailer::Base
mail(:to => @user['email'], :subject => "gitlab | #{@note.project.name} ")
end
- def note_commit_email(user, note)
- @user = user
- @note = Note.find(note['id'])
- @project = @note.project
+ def note_commit_email(recipient_id, note_id)
+ recipient = User.find(recipient_id)
+ @note = Note.find(note_id)
@commit = @note.target
- mail(:to => @user['email'], :subject => "gitlab | note for commit | #{@note.project.name} ")
+ mail(:to => recipient.email, :subject => "gitlab | note for commit | #{@note.project.name} ")
end
def note_merge_request_email(recipient_id, note_id)