summaryrefslogtreecommitdiff
path: root/users/app/models/email.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-10-10 10:56:09 -0700
committerjessib <jessib@riseup.net>2013-10-10 10:56:09 -0700
commit0acbf6a158f149c1f4273bde0cfca47547e080f8 (patch)
tree7e836d84ef8b879670b54eaaf6a8d3ae53ab7e14 /users/app/models/email.rb
parentb60a75d8cbe25ac47bb037e9e54a7cf4e2ba4e1f (diff)
parentd6491496704b3909a93b5883f049becb408e0e47 (diff)
Merge pull request #96 from azul/release/0.2.4
Release/0.2.4
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