From 8a3deb98cd3f565ba3bdb7c2256bdcaf1ba3d643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 30 Mar 2011 14:40:03 +0200 Subject: [PATCH] Add a descriptive text for those upgrading. --- lib/devise/rails.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/devise/rails.rb b/lib/devise/rails.rb index f01f8d43..f08f91f2 100644 --- a/lib/devise/rails.rb +++ b/lib/devise/rails.rb @@ -17,6 +17,17 @@ module Devise Devise.include_helpers(Devise::Controllers) end + initializer "devise.auth_keys" do + if Devise.authentication_keys.size > 1 + puts "[DEVISE] You are configuring Devise to use more than one authentication key. " \ + "In previous versions, we automatically added #{Devise.authentication_keys[1..-1].inspect} " \ + "as scope to your e-mail validation, but this was changed now. If you were relying in such " \ + "behavior, you should remove :validatable from your models and add the validations manually. " \ + "To get rid of this warning, you can comment config.authentication_keys in your initializer " \ + "and pass the current values as key to the devise call in your model." + end + end + initializer "devise.omniauth" do |app| Devise.omniauth_configs.each do |provider, config| app.middleware.use config.strategy_class, *config.args do |strategy|