From 31312998cfdf6b494c95beabcde34bc4151008fc Mon Sep 17 00:00:00 2001 From: John Dyer Date: Thu, 1 Dec 2011 11:17:48 -0500 Subject: [PATCH] Fix preference registration --- lib/spree/captcha/config.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/spree/captcha/config.rb b/lib/spree/captcha/config.rb index a6e9b9c..132e568 100644 --- a/lib/spree/captcha/config.rb +++ b/lib/spree/captcha/config.rb @@ -1,10 +1,15 @@ -module Spree::Captcha - class Config < Spree::Config - class << self - def instance - return nil unless ActiveRecord::Base.connection.tables.include?('configurations') - CaptchaConfiguration.find_or_create_by_name('Captcha configuration') +module Spree + module Captcha + class Config + include Singleton + include PreferenceAccess + + class << self + def instance + return nil unless ActiveRecord::Base.connection.tables.include?('configurations') + Spree::CaptchaConfiguration.find_or_create_by_name('Captcha configuration') + end end end end -end \ No newline at end of file +end