public
Fork of halorgium/mephisto
Description: A refactored Mephisto that has multiple spam detection engines.
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/francois/mephisto.git
Search Repo:
Force the full constant name in sites.spam_detection_engine.
francois (author)
Fri Feb 29 20:49:40 -0800 2008
commit  940af6ed7efa0cb5f1100dd5ba34e1a1b77fca24
tree    9345d55232bdbb4c09d1a1b8f953ef0870edd550
parent  0a55c3f8fefd682b26c8cbd79f1954a8e7511825
...
98
99
100
101
 
102
103
104
...
98
99
100
 
101
102
103
104
0
@@ -98,7 +98,7 @@ class Site < ActiveRecord::Base
0
   def spam_engine
0
     klass_name = read_attribute(:spam_detection_engine)
0
     return Mephisto::SpamDetectionEngine::Null.new(self) if klass_name.blank?
0
- Mephisto::SpamDetectionEngine.const_get(klass_name.classify).new(self)
0
+ klass_name.constantize.new(self)
0
   end
0
 
0
   # Compatibility shim until the Akismet engine is moved outside.
...
7
8
9
10
 
11
12
13
...
7
8
9
 
10
11
12
13
0
@@ -7,7 +7,7 @@ context "Site" do
0
   end
0
 
0
   specify "should return the Mephisto::SpamDetectionEngine::Defensio engine when the spam_detection_engine column has value 'defensio'" do
0
- assert_kind_of Mephisto::SpamDetectionEngine::Defensio, Site.new(:spam_detection_engine => "defensio").spam_engine
0
+ assert_kind_of Mephisto::SpamDetectionEngine::Defensio, Site.new(:spam_detection_engine => "Mephisto::SpamDetectionEngine::Defensio").spam_engine
0
   end
0
 
0
   specify "should serialize spam_engine_options" do

Comments

    No one has commented yet.