From ebe3e791d6d9b8824a6f0d49e9ddd0a20185c61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 12 Jul 2010 07:29:45 +0200 Subject: [PATCH] Email should be case insensitive, closes #372 --- CHANGELOG.rdoc | 1 + lib/devise/models/validatable.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 533d3b9e..db5ae6a2 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -11,6 +11,7 @@ * Devise should respect script_name and path_info contracts * Fix a bug when accessing a path with (.:format) (by github.com/klacointe) * Do not add unlock routes unless unlock strategy is email or both + * Email should be case insensitive * deprecations * use_default_scope is deprecated and has no effect. Use :as or :devise_scope in the router instead diff --git a/lib/devise/models/validatable.rb b/lib/devise/models/validatable.rb index 01020128..3977e6a7 100644 --- a/lib/devise/models/validatable.rb +++ b/lib/devise/models/validatable.rb @@ -16,7 +16,7 @@ module Devise base.class_eval do validates_presence_of :email - validates_uniqueness_of :email, :scope => authentication_keys[1..-1], :allow_blank => true + validates_uniqueness_of :email, :scope => authentication_keys[1..-1], :case_sensitive => false, :allow_blank => true validates_format_of :email, :with => email_regexp, :allow_blank => true with_options :if => :password_required? do |v|