Decorate users in UserMailer

This commit is contained in:
Marcin Kulik 2012-12-08 20:48:22 +01:00
parent a1fad7ccb7
commit 780dff5db1

View File

@ -4,9 +4,10 @@ class UserMailer < ActionMailer::Base
def new_comment_email(user, comment)
@comment = comment
@author = comment.user
@author = UserDecorator.new(comment.user)
@asciicast = AsciicastDecorator.new(@comment.asciicast)
user = UserDecorator.new(user)
to = "~#{user.nickname} <#{user.email}>"
subject = %(New comment for #{@asciicast.title})
mail :to => to, :subject => subject