Permalink
Browse files

Removing :case_sensitive option from validates_uniqueness_of. It was …

…unnecessary and causes a small performance problem on some apps. Resolves #148
  • Loading branch information...
1 parent 7ae6408 commit 56f0f0489a138d64794136e133c5848183c576d5 @croaky croaky committed Apr 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/clearance/user.rb
View
@@ -45,7 +45,7 @@ module Validations
# :password must be present, confirmed
included do
validates_presence_of :email, :unless => :email_optional?
- validates_uniqueness_of :email, :case_sensitive => false, :allow_blank => true
+ validates_uniqueness_of :email, :allow_blank => true
validates_format_of :email, :with => %r{^[a-z0-9!#\$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#\$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$}i, :allow_blank => true
validates_presence_of :password, :unless => :password_optional?

0 comments on commit 56f0f04

Please sign in to comment.