1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

15 commits

Author SHA1 Message Date
Carl Lerche
7176ade35b Do not require that validation attributes be specified as symbols 2011-02-05 15:37:38 -08:00
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
Obie Fernandez
275f922a23 Better shortcut options for custom validators [#5672 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 12:49:16 +02:00
Xavier Noria
ea2ad26a8d you rarely want ^ or $ in validations, use \A when you mean \A 2010-08-18 00:15:01 +02:00
Trey Bean
bee414748c Missing object for comparison in ActiveModel::EachValidator example code. 2010-08-17 12:51:13 -06:00
Santiago Pastorino
b95d6e84b0 Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 13:17:32 +02:00
Xavier Noria
fff917e37d fixes a typo reported by rymai 2010-08-10 15:34:54 +02:00
Rizwan Reza
3ae67fbebb Add titles to the rest of the files in active_model/validations/* 2010-06-15 22:20:19 +04:30
Evgeniy Dolzhenko
ccf9577aee Fix a bunch of minor spelling mistakes 2010-06-11 14:15:34 +04:00
José Valim
afd0c06dfa Validates needs hash slice. 2010-01-17 09:57:16 +01:00
José Valim
b078f7fd39 Fix typos and add tests to ensure they will be caught the next time. 2010-01-11 23:38:35 +01:00
José Valim
017f5d5308 Fix typo by renaming :genre to :gender. 2010-01-09 00:18:07 +01:00
José Valim
7045c4c279 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
2010-01-08 21:36:04 +01:00
José Valim
47a5fd4c4b Allow :if, :unless, :on, :allow_nil and :allow_blank as shared options in validates. 2010-01-07 19:23:59 +01:00
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