lib/simple_captcha/engine.rb in galetahub-simple_captcha-0.1.2 vs lib/simple_captcha/engine.rb in galetahub-simple_captcha-0.1.3
- old
+ new
@@ -7,19 +7,23 @@
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
+ 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