aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/validators/email_validator.rb
Commit message (Collapse)AuthorAgeFilesLines
* use \A and \z when you mean \A and \zXavier Noria2016-07-241-1/+1
| | | | | | | | | | | | | In Ruby ^ and $ mean start and end of *line*. A regexp that validates an email should not check if some line of the string looks like an email, and maybe be surrounded by the entire Joyce's Ulysses. What the regexp has to check is if the string itself looks like an email. This validator is used only in tests, the ^/$ anchors implied no risk.
* systematic revision of =~ usage in AMoXavier Noria2016-07-241-2/+4
|
* Add validates method as shortcut to setup validators for a given set of ↵jamie2010-01-071-0/+6
attributes: class Person < ActiveRecord::Base include MyValidators validates :name, :presence => true, :uniqueness => true, :length => { :maximum => 100 } validates :email, :presence => true, :email => true end [#3058 status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>