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.
This commit is contained in:
Robb Kidd 2012-05-15 19:20:15 -04:00
parent 435fd8f087
commit 0a9a2c2a0b
3 changed files with 9 additions and 9 deletions

View file

@ -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)