aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow validates to map some types to specific options. So now you can do:José Valim2010-01-081-11/+37
| | | | | | validates :email, :presence => true, :format => /@/ validates :genre, :inclusion => %w(m f) validates :password, :length => 6..20
* Compile length validator options still at the class level, so whenever the ↵José Valim2010-01-081-4/+2
| | | | validator is called, it just needs to check for :maximum, :minimum and :is values.
* Allow :if, :unless, :on, :allow_nil and :allow_blank as shared options in ↵José Valim2010-01-071-3/+38
| | | | validates.
* Add validates method as shortcut to setup validators for a given set of ↵jamie2010-01-072-0/+75
| | | | | | | | | | | | | | | 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>
* Be sure to dup load paths before clearing the array.José Valim2010-01-071-1/+1
|
* Errors messages are now moved from :activerecord.errors to simply :errors on ↵José Valim2010-01-072-80/+44
| | | | I18n yml files.
* Add missing tests to Validators.José Valim2010-01-031-0/+47
|
* Remove deprecated ActiveModel tests (%d and %s is no longer supported in ↵José Valim2010-01-021-14/+0
| | | | error messages a couple months already)
* Use activerecord.errors.format as in Rails 2.3.5.José Valim2010-01-021-0/+6
|
* Be sure to convert namespaced names to we have 'Parrots name' instead of ↵José Valim2010-01-021-1/+1
| | | | 'Parrots.name' in error messages.
* No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵José Valim2009-12-2311-199/+116
| | | | Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
* Move validations in ActiveModel to validators, however all validatity checks ↵José Valim2009-12-231-2/+2
| | | | are still in the class method.
* Validator is simply sent to validate method. However, the API needs to ↵José Valim2009-12-221-6/+6
| | | | change, so validate accepts a record.
* Move validator, human_name and human_attribute_name to ActiveModel, remove ↵José Valim2009-10-203-5/+12
| | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com>
* Use ActiveModel::TestCase base classJeremy Kemper2009-09-241-1/+1
|
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-082-17/+4
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Fix warnings in AMoJoshua Peek2009-09-051-45/+1
|
* Fix failing AMo isolated testsJoshua Peek2009-09-052-0/+3
|
* added proc and symbol support to validates_numericality_of [#3049 ↵Kane2009-08-311-0/+18
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Add validates_format_of :without => /regexp/ option [Elliot Winkler, Peer Allan]Elliot Winkler2009-08-101-0/+29
| | | | | | | | | | [#430 state:resolved] Example : validates_format_of :subdomain, :without => /www|admin|mail/ Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Introduce validates_with to encapsulate attribute validations in a class.Jeff Dean2009-08-091-0/+116
| | | | | | [#2630 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix exclusive range patch to use begin/end instead of min/max. [#2981 ↵Adam Keys2009-08-081-0/+14
| | | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Simplyfy validates_length_of and remove putsPratik Naik2009-08-081-1/+0
|
* validates_length_of with maximum should allow nil [#2309 status:resolved]jzw2009-08-081-3/+7
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Allow validations to use values from custom readers [#2936 state:resolved]James Hill2009-08-051-0/+14
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Simplify AMo validation attribute readerJoshua Peek2009-06-171-9/+9
|
* Merge branch 'master' into active_modelJoshua Peek2009-05-291-20/+8
| | | | | | | | | | | Conflicts: activemodel/lib/active_model/core.rb activemodel/test/cases/state_machine/event_test.rb activemodel/test/cases/state_machine/state_transition_test.rb activerecord/lib/active_record/validations.rb activerecord/test/cases/validations/i18n_validation_test.rb activeresource/lib/active_resource.rb activeresource/test/abstract_unit.rb
* Deprecate Errors#on_base/add_to_base/invalid?/each_fullPratik Naik2009-03-211-3/+3
|
* Add ActiveModel::Validations tests for regular ruby classesPratik Naik2009-03-208-27/+150
|
* Add I18n translations to ActiveModel and move more AR specific parts to ↵Pratik Naik2009-03-203-404/+320
| | | | ActiveRecord::Validations
* Deprecate Error#on(attribute) in favour of Errors#[attribute]Pratik Naik2009-03-206-65/+65
|
* TestDatabase -> TestsDatabasePratik Naik2009-03-2010-19/+19
|
* Move relevant validation tests from Active Record to Active ModelPratik Naik2009-03-2011-0/+1931