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/admin | |
parent | 0aace2986a9a7a6d4c84a9ba6819d3df7821e267 (diff) | |
download | thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.gz thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.bz2 thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.zip |
Added comment replying
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/comments_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/admin/comments_controller.rb b/app/controllers/admin/comments_controller.rb index ccde3e6..9958232 100644 --- a/app/controllers/admin/comments_controller.rb +++ b/app/controllers/admin/comments_controller.rb | |||
@@ -14,6 +14,10 @@ class Admin::CommentsController < Admin::AdminController | |||
14 | @comment.status = :published | 14 | @comment.status = :published |
15 | @comment.save! | 15 | @comment.save! |
16 | 16 | ||
17 | if @comment.reply_to and @comment.reply_to.email != @comment.blog.user.email and @comment.reply_to.email != current_user.email | ||
18 | CommentMailer.with(comment: @comment).reply_comment_email.deliver_later | ||
19 | end | ||
20 | |||
17 | flash.notice = "Comment successfully published." | 21 | flash.notice = "Comment successfully published." |
18 | redirect_to pending_admin_comments_url | 22 | redirect_to pending_admin_comments_url |
19 | end | 23 | end |