lib/simple_captcha/engine.rb in glebtv-simple_captcha-0.2.0 vs lib/simple_captcha/engine.rb in glebtv-simple_captcha-0.2.1
- old
+ new
@@ -3,11 +3,13 @@
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)
+ unless defined?(Mongoid)
+ ActiveSupport.on_load :active_record do
+ ActiveRecord::Base.send(:include, SimpleCaptcha::ModelHelpers)
+ end
end
end
config.after_initialize do
ActionView::Base.send(:include, SimpleCaptcha::ViewHelper)