Commit 09e8041b54569567d96b93adf97509f03db268b3

Authored by Rodrigo Souto
1 parent 9df90de8

[comments-refactor-review] Replacing plugins direct call with dispatch

Showing 1 changed file with 1 additions and 7 deletions   Show diff stats
app/controllers/public/comment_controller.rb
@@ -34,7 +34,7 @@ class CommentController < ApplicationController @@ -34,7 +34,7 @@ class CommentController < ApplicationController
34 @comment.ip_address = request.remote_ip 34 @comment.ip_address = request.remote_ip
35 @comment.user_agent = request.user_agent 35 @comment.user_agent = request.user_agent
36 @comment.referrer = request.referrer 36 @comment.referrer = request.referrer
37 - plugins_filter_comment(@comment) 37 + @plugins.dispatch(:filter_comment, @comment)
38 38
39 if @comment.rejected? 39 if @comment.rejected?
40 respond_to do |format| 40 respond_to do |format|
@@ -172,12 +172,6 @@ class CommentController < ApplicationController @@ -172,12 +172,6 @@ class CommentController < ApplicationController
172 172
173 protected 173 protected
174 174
175 - def plugins_filter_comment(comment)  
176 - @plugins.each do |plugin|  
177 - plugin.filter_comment(comment)  
178 - end  
179 - end  
180 -  
181 def pass_without_comment_captcha? 175 def pass_without_comment_captcha?
182 logged_in? && !environment.enabled?('captcha_for_logged_users') 176 logged_in? && !environment.enabled?('captcha_for_logged_users')
183 end 177 end