Commit a9c0b2399bbf2228075da106db40a86ecfb29fa9
1 parent
c722f4b7
Exists in
master
and in
29 other branches
anti_spam_plugin: fix comment_handler loop
(ActionItem3062)
Showing
1 changed file
with
6 additions
and
4 deletions
Show diff stats
plugins/anti_spam/lib/anti_spam_plugin/wrapper.rb
| 1 | 1 | class AntiSpamPlugin::Wrapper < SimpleDelegator |
| 2 | 2 | include Rakismet::Model |
| 3 | 3 | |
| 4 | - @@wrappers = [] | |
| 4 | + @@wrappers = [AntiSpamPlugin::CommentWrapper, AntiSpamPlugin::SuggestArticleWrapper] | |
| 5 | 5 | |
| 6 | 6 | def self.wrap(object) |
| 7 | 7 | wrapper = @@wrappers.find { |wrapper| wrapper.wraps?(object) } |
| ... | ... | @@ -12,7 +12,9 @@ class AntiSpamPlugin::Wrapper < SimpleDelegator |
| 12 | 12 | false |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | - def self.inherited(child) | |
| 16 | - @@wrappers << child | |
| 17 | - end | |
| 15 | +# FIXME You can't take for granted that the wrappers will be loaded and, therefore, | |
| 16 | +# included in the @@wrappers variable. | |
| 17 | +# def self.inherited(child) | |
| 18 | +# @@wrappers << child | |
| 19 | +# end | |
| 18 | 20 | end | ... | ... |