This project is archived and is in readonly mode.
validates_email
-
Frederick Cheung
You're missing several top level domains, which sort of illustrates the futility of trying to be this explicit (especially now that icann will soon be having a far more open process for tld creation). You're far better off with a very simplistic regex and then actually sending the person a confirmation email
-
josh
I think this is a little to domain specific, but I think we compromise by just adding an ActiveRecord::Validations::EmailAddressRegexp constant.
-
ronin-41439 (at lighthouseapp)
Hey Guys,
thanks for the feedback! Seems that there are two options; * adjust the domain-name check * add a constant as Joshua suggests
I created a new patch that checks the top-level domainname to be 2 characters or more. Maybe that will get the patch accepted :-D?
Since this is my first patch; would you suggest opening up a new ticket with the new patch or add it to this ticket as I'm doing now?
Joshua; with "domain specific"; do you mean that checking email is too domain specific, or that the regex is too domain specific (sorry my English isn't that good :-s)
Thanks guys, hope you like the new patch.
Stijn
-
Pratik
- Assigned user set to Pratik
- State changed from new to wontfix
I really think this belongs to plugin. I'm sure there are existing plugins that does the same thing. Hopefully, we'll soon have something like http://github.com/leethal/active... which will make things a lot easier.
Having said that, I like Josh's idea too. So if there is an rfc compliant regexp for this, I'd be favor of having that in core.
Closing till we have a new patch.
Thanks.
-
Pratik
Stijn, if you need any sort of help - please feel free to catch me ("lifo") on irc ( irc.freenode.net - #rails-contrib ).
Thanks for your time!
-
ronin-41439 (at lighthouseapp)
Hey guys,
wow, thanks for the great replies and thanks for the support. Although this patch isn't going to be accepted, I still feel like I've contributed to something ;-)
Implementing an rfc compliant regex won't solve the problem (for more info, read here: http://www.regular-expressions.i.... But, if you want to use the ported regex from my latest patch, please do :-)
Cheers,
Stijn
