summaryrefslogtreecommitdiff
path: root/users/app/models/email.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-10-10 09:52:16 +0200
committerAzul <azul@leap.se>2013-10-10 09:52:16 +0200
commitb676e6e6f5367d1be540af817062a77ee3fe7f00 (patch)
tree107c50e838d3fe2feb7da932869a9aabc62ce46b /users/app/models/email.rb
parentb60a75d8cbe25ac47bb037e9e54a7cf4e2ba4e1f (diff)
parenteaedf19e2e54ccb9933caa8dc21df13e48609b18 (diff)
Merge remote-tracking branch 'leap/develop'
Diffstat (limited to 'users/app/models/email.rb')
-rw-r--r--users/app/models/email.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/users/app/models/email.rb b/users/app/models/email.rb
index 1bcff1c..a9a503f 100644
--- a/users/app/models/email.rb
+++ b/users/app/models/email.rb
@@ -3,7 +3,7 @@ class Email < String
validates :email,
:format => {
- :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/,
+ :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/, #local part of email is case-sensitive, so allow uppercase letter.
:message => "needs to be a valid email address"
}
@@ -19,4 +19,8 @@ class Email < String
self
end
+ def handle
+ self.split('@').first
+ end
+
end