diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-14 11:12:05 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-14 11:12:05 -0400 |
commit | fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd (patch) | |
tree | 27d42a442c000781d100dfa7fd8b976aefb03c31 /app/controllers/comments_controller.rb | |
parent | 0aace2986a9a7a6d4c84a9ba6819d3df7821e267 (diff) | |
download | thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.gz thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.bz2 thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.zip |
Added comment replying
Diffstat (limited to 'app/controllers/comments_controller.rb')
-rw-r--r-- | app/controllers/comments_controller.rb | 6 |
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 |
65 | end | 69 | end |