aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/validators/email_validator.rb
Commit message (Collapse)AuthorAgeFilesLines
* let Regexp#match? be globally availableXavier Noria2016-10-271-1/+0
| | | | | | Regexp#match? should be considered to be part of the Ruby core library. We are emulating it for < 2.4, but not having to require the extension is part of the illusion of the emulation.
* applies new string literal convention in activemodel/testXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* 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>