diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-08 08:37:58 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-08 21:36:04 +0100 |
commit | 7045c4c279499eb7340fb420398d613497739eef (patch) | |
tree | c62d42b74d68a738a3baa935add403e10305f70d /activemodel/test/models/person.rb | |
parent | fa14d6d51ed89acde66b49e8d3a6423396c3d553 (diff) | |
download | rails-7045c4c279499eb7340fb420398d613497739eef.tar.gz rails-7045c4c279499eb7340fb420398d613497739eef.tar.bz2 rails-7045c4c279499eb7340fb420398d613497739eef.zip |
Allow validates to map some types to specific options. So now you can do:
validates :email, :presence => true, :format => /@/
validates :genre, :inclusion => %w(m f)
validates :password, :length => 6..20
Diffstat (limited to 'activemodel/test/models/person.rb')
-rw-r--r-- | activemodel/test/models/person.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/test/models/person.rb b/activemodel/test/models/person.rb index 53ac68055f..86e8d73bbb 100644 --- a/activemodel/test/models/person.rb +++ b/activemodel/test/models/person.rb @@ -2,7 +2,7 @@ class Person include ActiveModel::Validations extend ActiveModel::Translation - attr_accessor :title, :karma, :salary + attr_accessor :title, :karma, :salary, :genre, :password def condition_is_true true |