diff options
author | jomo <github@jomo.tv> | 2014-05-04 23:03:11 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-05-04 23:03:11 +0200 |
commit | 4ee8ce36f12c77fb52b8e5df508dbdce8d148b8b (patch) | |
tree | f38298ea157337655d2978da48a426a4e1de2c2a /app/models/user.rb | |
parent | 2ec5238e37b9bd4ed6b90bd7f6e1185cf7e6781f (diff) |
fix IPv6 email regex, get ready for token registration
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 7b7b297..ccdb8e7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -18,7 +18,7 @@ class User < ActiveRecord::Base validates_length_of :about, maximum: 5000 validates_length_of :ign, minimum: 1, maximum: 16 - validates :email, uniqueness: {case_sensitive: false}, format: {with: /\A.+@(.+\..{2,}|\[[0-9:.]+\])\z/i, message: "That doesn't look like an email adress."} + validates :email, uniqueness: {case_sensitive: false}, format: {with: /\A.+@(.+\..{2,}|\[[0-9a-f:.]+\])\z/i, message: "That doesn't look like an email adress."} validates :ign, uniqueness: {case_sensitive: false}, format: {with: /\A[a-z\d_]+\z/i, message: "Username is invalid (a-z, 0-9, _)."} validate :account_exists?, :if => lambda {|user| user.ign_changed? } |