summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-09-26 12:06:25 -0700
committerjessib <jessib@riseup.net>2013-09-26 12:06:25 -0700
commitaf9d843d646cf500306de0ad20896c05ecaccd78 (patch)
treefab1426f3ba181d7697443e058656774c16ff15a /users/app
parentdba941539011f5e0634585e6c11a1c7f58110876 (diff)
Since local part of email is case sensitive, want to allow remote email addresses with uppercase letters in local part.
Diffstat (limited to 'users/app')
-rw-r--r--users/app/models/email.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/users/app/models/email.rb b/users/app/models/email.rb
index f38f2f5..a9a503f 100644
--- a/users/app/models/email.rb
+++ b/users/app/models/email.rb
@@ -3,16 +3,10 @@ class Email < String
validates :email,
:format => {
- :with => /\A([^@\s]+)@((?:[-a-zA-Z0-9]+\.)+[a-zA-Z]{2,})\Z/, #checks format, but allows lowercase
+ :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"
}
- validates :email,
- :format => {
- :with => /\A[^A-Z]*\Z/, #forbids uppercase characters
- :message => "letters must be lowercase"
- }
-
def to_partial_path
"emails/email"
end