From a9c0b2399bbf2228075da106db40a86ecfb29fa9 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 26 Mar 2014 15:23:44 +0000 Subject: [PATCH] anti_spam_plugin: fix comment_handler loop --- plugins/anti_spam/lib/anti_spam_plugin/wrapper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/anti_spam/lib/anti_spam_plugin/wrapper.rb b/plugins/anti_spam/lib/anti_spam_plugin/wrapper.rb index 8781b8d..8bf1602 100644 --- a/plugins/anti_spam/lib/anti_spam_plugin/wrapper.rb +++ b/plugins/anti_spam/lib/anti_spam_plugin/wrapper.rb @@ -1,7 +1,7 @@ class AntiSpamPlugin::Wrapper < SimpleDelegator include Rakismet::Model - @@wrappers = [] + @@wrappers = [AntiSpamPlugin::CommentWrapper, AntiSpamPlugin::SuggestArticleWrapper] def self.wrap(object) wrapper = @@wrappers.find { |wrapper| wrapper.wraps?(object) } @@ -12,7 +12,9 @@ class AntiSpamPlugin::Wrapper < SimpleDelegator false end - def self.inherited(child) - @@wrappers << child - end +# FIXME You can't take for granted that the wrappers will be loaded and, therefore, +# included in the @@wrappers variable. +# def self.inherited(child) +# @@wrappers << child +# end end -- libgit2 0.21.2