Commit 09e8041b54569567d96b93adf97509f03db268b3
1 parent
9df90de8
Exists in
master
and in
29 other branches
[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 | 34 | @comment.ip_address = request.remote_ip |
35 | 35 | @comment.user_agent = request.user_agent |
36 | 36 | @comment.referrer = request.referrer |
37 | - plugins_filter_comment(@comment) | |
37 | + @plugins.dispatch(:filter_comment, @comment) | |
38 | 38 | |
39 | 39 | if @comment.rejected? |
40 | 40 | respond_to do |format| |
... | ... | @@ -172,12 +172,6 @@ class CommentController < ApplicationController |
172 | 172 | |
173 | 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 | 175 | def pass_without_comment_captcha? |
182 | 176 | logged_in? && !environment.enabled?('captcha_for_logged_users') |
183 | 177 | end | ... | ... |