Sha256: f012297a27d13d962068e80aca8697ccefb56e1ff03acf008984de1929e26b93

Contents?: true

Size: 835 Bytes

Versions: 14

Compression:

Stored size: 835 Bytes

Contents

# encoding: utf-8
require 'rails'
require 'simple_captcha'

module SimpleCaptcha
  class Engine < ::Rails::Engine
    config.before_initialize do
      ActiveSupport.on_load :active_record do
        ActiveRecord::Base.send(:include, SimpleCaptcha::ModelHelpers)
      end
    end

    config.after_initialize do
      ActionView::Base.send(:include, SimpleCaptcha::ViewHelper)
      ActionView::Helpers::FormBuilder.send(:include, SimpleCaptcha::FormBuilder)

      if Object.const_defined?("Formtastic")
        if Formtastic.const_defined?("Helpers")
          Formtastic::Helpers::FormHelper.builder = SimpleCaptcha::CustomFormBuilder
        else
          Formtastic::SemanticFormHelper.builder = SimpleCaptcha::CustomFormBuilder
        end
      end
    end

    config.app_middleware.use SimpleCaptcha::Middleware
  end
end


Version data entries

14 entries across 14 versions & 7 rubygems

Version Path
pludoni-simple_captcha-0.1.6 lib/simple_captcha/engine.rb
galetahub-simple_captcha-0.1.5 lib/simple_captcha/engine.rb
galetahub-simple_captcha-0.1.4 lib/simple_captcha/engine.rb
loyal_simple_captcha-0.0.1 lib/simple_captcha/engine.rb
foco-simple_captcha-0.1.3 lib/simple_captcha/engine.rb
nahaylo-simple_captcha-0.2.0 lib/simple_captcha/engine.rb
the_captcha-0.1.3 lib/simple_captcha/engine.rb
the_captcha-0.1.1 lib/simple_captcha/engine.rb
the_captcha-0.1.0 lib/simple_captcha/engine.rb
wolcanus-simple_captcha-0.1.6 lib/simple_captcha/engine.rb
wolcanus-simple_captcha-0.1.5 lib/simple_captcha/engine.rb
wolcanus-simple_captcha-0.1.4 lib/simple_captcha/engine.rb
wolcanus-simple_captcha-0.1.3 lib/simple_captcha/engine.rb
galetahub-simple_captcha-0.1.3 lib/simple_captcha/engine.rb