From 68f699bfd4d027e77fd8b8f8969cf951d9f3f550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 21 Jan 2011 10:55:40 +0100 Subject: [PATCH] Do not change default behavior of previous apps. --- lib/devise.rb | 3 ++- lib/generators/templates/devise.rb | 2 +- test/rails_app/config/initializers/devise.rb | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/devise.rb b/lib/devise.rb index 653e5cde..89c8f686 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -68,8 +68,9 @@ module Devise @@request_keys = [] # Keys that should be case-insensitive. + # Empty by default for backwards compaibility. mattr_accessor :case_insensitive_keys - @@case_insensitive_keys = [ :email ] + @@case_insensitive_keys = [ ] # If http authentication is enabled by default. mattr_accessor :http_authenticatable diff --git a/lib/generators/templates/devise.rb b/lib/generators/templates/devise.rb index 7101cf0a..b80946fa 100644 --- a/lib/generators/templates/devise.rb +++ b/lib/generators/templates/devise.rb @@ -34,7 +34,7 @@ Devise.setup do |config| # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. - # config.case_insensitive_keys = [ :email ] + config.case_insensitive_keys = [ :email ] # Tell if authentication through request.params is enabled. True by default. # config.params_authenticatable = true diff --git a/test/rails_app/config/initializers/devise.rb b/test/rails_app/config/initializers/devise.rb index 1aeee649..b7a79708 100644 --- a/test/rails_app/config/initializers/devise.rb +++ b/test/rails_app/config/initializers/devise.rb @@ -31,6 +31,11 @@ Devise.setup do |config| # The same considerations mentioned for authentication_keys also apply to request_keys. # config.request_keys = [] + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [ :email ] + # Tell if authentication through request.params is enabled. True by default. # config.params_authenticatable = true