aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/with_validation_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use the new clear_validators! api to reset validators in testsCarlos Antonio da Silva2014-01-271-2/+1
|
* deprecate Validator#setup (to get rid of a respond_to call). validators do ↵Nick Sutterer2013-05-231-23/+1
| | | | their setup in their constructor now.
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-011-18/+18
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* fix some typos found in activemodelVipul A M2013-03-181-1/+1
|
* Raise ArgumentError when no attribute is given to AMo::EachValidatorCarlos Antonio da Silva2012-11-041-1/+1
| | | | ArgumentError is better suited than RuntimeError for this.
* Optionally pass in the attribute being validated to an instance method validatorCarl Lerche2011-02-051-0/+9
|
* Be able to pass a validator method to #validatesCarl Lerche2011-02-051-0/+12
|
* removed AR from all AMo tests, including any unneeded files (schema, ↵Josh Kalderimis2010-05-091-2/+0
| | | | fixtures and test helper)
* removed use of AR in AMo tests and removed testing of scopes (:on) in ↵Josh Kalderimis2010-05-081-23/+10
| | | | individual validation tests and moved them to their own test file
* Add validators reflection so you can do 'Person.validators' and ↵Prem Sichanugrist2010-02-211-0/+1
| | | | | | 'Person.validators_on(:name)'. Signed-off-by: José Valim <jose.valim@gmail.com>
* Add validates method as shortcut to setup validators for a given set of ↵jamie2010-01-071-0/+22
| | | | | | | | | | | | | | | 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>
* Add missing tests to Validators.José Valim2010-01-031-0/+47
|
* No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵José Valim2009-12-231-2/+3
| | | | 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-201-4/+4
| | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com>
* Fix failing AMo isolated testsJoshua Peek2009-09-051-0/+2
|
* 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>