about summary refs log tree commit diff stats
path: root/app/controllers/comments_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/comments_controller.rb')
-rw-r--r--app/controllers/comments_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index a444dba..2f3117f 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb
@@ -46,6 +46,10 @@ class CommentsController < ApplicationController
46 46
47 if @comment.status == :published 47 if @comment.status == :published
48 CommentMailer.with(comment: @comment).new_comment_email.deliver_later 48 CommentMailer.with(comment: @comment).new_comment_email.deliver_later
49
50 if @comment.reply_to and @comment.reply_to.email != @comment.blog.user.email
51 CommentMailer.with(comment: @comment).reply_comment_email.deliver_later
52 end
49 else 53 else
50 CommentMailer.with(comment: @comment).new_pending_comment_email.deliver_later 54 CommentMailer.with(comment: @comment).new_pending_comment_email.deliver_later
51 end 55 end
@@ -60,6 +64,6 @@ class CommentsController < ApplicationController
60 private 64 private
61 65
62 def comment_params 66 def comment_params
63 params.require(:comment).permit(:username, :email, :website, :body) 67 params.require(:comment).permit(:username, :email, :website, :body, :reply_to_id)
64 end 68 end
65end 69end