Kir Shatrov
d7b1521db8
Use frozen string literal in activemodel/
2017-07-16 20:11:16 +03:00
Matthew Draper
87b3e226d6
Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
...
This reverts commit 3420a14590
, reversing
changes made to afb66a5a59
.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e
Enforce frozen string in Rubocop
2017-07-01 02:11:03 +03:00
Ryuta Kamizono
faca40dfd4
✂️
...
[ci skip]
2017-04-13 07:15:04 +09:00
Xavier Noria
56832e791f
let Regexp#match? be globally available
...
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.
2016-10-27 09:13:55 +02:00
Xavier Noria
4c20825457
applies new string literal convention in activemodel/test
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:38:23 +02:00
Xavier Noria
11b463d8cb
use \A and \z when you mean \A and \z
...
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.
2016-07-24 21:42:19 +02:00
Xavier Noria
5a83f05424
systematic revision of =~ usage in AMo
2016-07-24 21:23:23 +02:00
Santiago Pastorino
9cfbada93a
This is not an executable file
2010-12-16 01:49:28 +05:30
Samuel Kadolph
972011a2e5
Add support for namespaced validators
...
Includes test and documentation for new feature
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-12-16 01:49:28 +05:30
jamie
0a79eb7889
Add validates method as shortcut to setup validators for a given set of 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>
2010-01-07 19:23:59 +01:00