Skip to content

Commit

Permalink
Fixes Captcha Settings preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
LBRapid committed Dec 6, 2011
1 parent 89d2eaf commit bbc7b0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/captcha_configuration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Spree::CaptchaConfiguration < Spree::Configuration
class Spree::CaptchaConfiguration < Spree::Preferences::Configuration
THEMES = ['red', 'white', 'blackglass', 'clean', 'custom']

# this keys works for localhost
Expand Down
15 changes: 0 additions & 15 deletions lib/spree/captcha/config.rb

This file was deleted.

8 changes: 7 additions & 1 deletion lib/spree_email_to_friend/engine.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
require 'recaptcha/rails'

module Spree::Captcha
end

module SpreeEmailToFriend
class Engine < Rails::Engine
engine_name 'spree_email_to_friend'

config.autoload_paths += %W(#{config.root}/lib)

initializer "spree.email_to_friend.preferences", :after => "spree.environment" do |app|
Spree::Captcha::Config = Spree::CaptchaConfiguration.new
end

def self.activate
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c|
Rails.application.config.cache_classes ? require(c) : load(c)
Expand All @@ -14,7 +21,6 @@ def self.activate
#Dir.glob(File.join(File.dirname(__FILE__), "../../app/overrides/*.rb")) do |c|
# Rails.application.config.cache_classes ? require(c) : load(c)
#end
Spree::CaptchaConfiguration.find_or_create_by_name("Default spree_captcha configuration")
end

config.to_prepare &method(:activate).to_proc
Expand Down

0 comments on commit bbc7b0b

Please sign in to comment.