From 09e8041b54569567d96b93adf97509f03db268b3 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Fri, 12 Jul 2013 15:31:03 -0300 Subject: [PATCH] [comments-refactor-review] Replacing plugins direct call with dispatch --- app/controllers/public/comment_controller.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/controllers/public/comment_controller.rb b/app/controllers/public/comment_controller.rb index a983746..c36b594 100644 --- a/app/controllers/public/comment_controller.rb +++ b/app/controllers/public/comment_controller.rb @@ -34,7 +34,7 @@ class CommentController < ApplicationController @comment.ip_address = request.remote_ip @comment.user_agent = request.user_agent @comment.referrer = request.referrer - plugins_filter_comment(@comment) + @plugins.dispatch(:filter_comment, @comment) if @comment.rejected? respond_to do |format| @@ -172,12 +172,6 @@ class CommentController < ApplicationController protected - def plugins_filter_comment(comment) - @plugins.each do |plugin| - plugin.filter_comment(comment) - end - end - def pass_without_comment_captcha? logged_in? && !environment.enabled?('captcha_for_logged_users') end -- libgit2 0.21.2