diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-09 23:28:37 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-09 23:28:37 -0400 |
commit | 32df12ee322bbe07b11758b87599ba192e4515d4 (patch) | |
tree | dab819ad297338393f768f38384c582e71cf058b /app/models/user.rb | |
parent | cbcd3f3037ba9a66cb15e6ed788334d7b89f9c23 (diff) |
clean up some styles and form stuff
Just look at the diff.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 46cd532..99761e7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -45,7 +45,8 @@ class User < ActiveRecord::Base before_save { self.email = email.downcase } validates(:email, presence: true, - format: {with: /\A\S+@\S+\.\S+\z/i}, + # This regex is taken from http://www.w3.org/TR/html5/forms.html#e-mail-state-%28type=email%29 + format: {with: /\A[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/}, uniqueness: { case_sensitive: false }) # user_name:string_uniq |