Sha256: 1e76507c77f2929d50904df6ae828ffb846831290632242e14abf156435a9b5a

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

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

module SimpleCaptcha
  class Railtie < ::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")
        Formtastic::SemanticFormHelper.builder = SimpleCaptcha::CustomFormBuilder
      end
    end
  end
end


Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
wxianfeng_simple_captcha-0.5.0 lib/simple_captcha/railtie.rb
wxianfeng_simple_captcha-0.4.0 lib/simple_captcha/railtie.rb
wxianfeng_simple_captcha-0.3.0 lib/simple_captcha/railtie.rb
wxianfeng_simple_captcha-0.2.0 lib/simple_captcha/railtie.rb
wxianfeng_simple_captcha-0.1.0 lib/simple_captcha/railtie.rb
galetahub-simple_captcha-0.1.1 lib/simple_captcha/railtie.rb
nogara-simple_captcha-0.1.1 lib/simple_captcha/railtie.rb