downcase before validation

This commit is contained in:
Raphael 2010-09-15 17:21:23 -07:00
parent bf33313bf9
commit 0e0df7fb22

View file

@ -37,7 +37,7 @@ class User
after_create :seed_aspects
before_save :downcase_username
before_validation_on_create :downcase_username
def self.find_for_authentication(conditions={})
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex