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.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index b305d0a..31fe411 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb
@@ -5,6 +5,12 @@ class CommentsController < ApplicationController
5 raise ActiveRecord::RecordNotFound unless @blog 5 raise ActiveRecord::RecordNotFound unless @blog
6 raise ActiveRecord::RecordNotFound unless @blog.published 6 raise ActiveRecord::RecordNotFound unless @blog.published
7 7
8 unless verify_recaptcha
9 flash.alert = "Error posting comment."
10 render "blogs/show"
11 return
12 end
13
8 @comment = @blog.comments.new(comment_params) 14 @comment = @blog.comments.new(comment_params)
9 @comment.request_ip = request.ip 15 @comment.request_ip = request.ip
10 @comment.user_agent = request.user_agent 16 @comment.user_agent = request.user_agent
@@ -56,7 +62,8 @@ class CommentsController < ApplicationController
56 CommentMailer.with(comment: @comment).reply_comment_email.deliver_later 62 CommentMailer.with(comment: @comment).reply_comment_email.deliver_later
57 end 63 end
58 else 64 else
59 CommentMailer.with(comment: @comment).new_pending_comment_email.deliver_later 65 # CommentMailer.with(comment: @comment).new_pending_comment_email.deliver_later
66 # I'm disabling pending comment emails, at least for now, because I am getting too many.
60 end 67 end
61 else 68 else
62 flash.alert = "Error posting comment." 69 flash.alert = "Error posting comment."