Skip to content

Commit

Permalink
Initializer caveats warning for Mongoid < 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ches committed Aug 4, 2011
1 parent 6bc9317 commit 7bfdd07
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/devise/rails.rb
Expand Up @@ -39,5 +39,18 @@ class Engine < ::Rails::Engine
Devise.include_helpers(Devise::OmniAuth)
end
end

initializer "devise.mongoid_version_warning" do
if defined?(Mongoid)
require 'mongoid/version'
if Mongoid::VERSION.to_f < 2.1
puts "\n[DEVISE] Please note that Mongoid versions prior to 2.1 handle dirty model " \
"object attributes in such a way that the Devise `validatable` module will not apply " \
"its usual uniqueness and format validations for the email field. It is recommended " \
"that you upgrade to Mongoid 2.1+ for this and other fixes, but if for some reason you " \
"are unable to do so, you should add these validations manually.\n"
end
end
end
end
end

0 comments on commit 7bfdd07

Please sign in to comment.