aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Ensure deprecated validate methods are invoked when they are private [#3214 ↵José Valim2010-01-181-1/+18
| | | | status:resolved]
* save(false) is gone, use save(:validate => false) instead.José Valim2010-01-171-1/+9
|
* Simplify repair_validations on AR and make it work with new callbacks.José Valim2010-01-011-14/+14
|
* Don't publicize with_scope for tests since it may shadow public misuseJeremy Kemper2009-12-281-3/+3
|
* Move validator, human_name and human_attribute_name to ActiveModel, remove ↵José Valim2009-10-201-31/+0
| | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com>
* Fix default_error_messages back to the original messageAkira Matsuda2009-09-111-3/+6
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-6/+3
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Deprecate Model#validate/validate_on_create/validate_on_update. Use ↵Pratik Naik2009-03-211-0/+34
| | | | Model.validate :method and likewise
* Deprecate Errors#on_base/add_to_base/invalid?/each_fullPratik Naik2009-03-211-2/+2
|
* Add ActiveModel::Validations tests for regular ruby classesPratik Naik2009-03-201-0/+9
|
* Add I18n translations to ActiveModel and move more AR specific parts to ↵Pratik Naik2009-03-201-0/+12
| | | | ActiveRecord::Validations
* Deprecate Error#on(attribute) in favour of Errors#[attribute]Pratik Naik2009-03-201-2/+2
|
* Move relevant validation tests from Active Record to Active ModelPratik Naik2009-03-201-1469/+1
|
* Move all the Active Record validations to Active ModelPratik Naik2009-03-191-125/+123
|
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-081-6/+6
| | | | [#1617 state:resolved]
* Add ActiveRecord::Base#invalid? as the opposite of #valid? [#2159 ↵Jeffrey Hardy2009-03-081-1/+12
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure validates_uniqueness_of considers limit on the field. [#1042 ↵Arthur Klepchukov2009-03-071-0/+9
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* DRY with_kcode in Active Record testsPratik Naik2009-03-071-14/+0
|
* validate_length_of should use custom message if given when using in or within.miloops2009-02-011-0/+13
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1057 state:committed]
* Add a repair_helper to repair changes to the validations inside ↵Murray Steele2008-12-191-160/+191
| | | | | | | | | | | | | | validations_test.rb [#674 state:resolved] Many of the tests in validations_test would add a new validation to models. However, only Topic was being reset with a fairly aggressive clearing of all validations. None of the other models being used however were recieving the same treatment. Now we use repair_validations(Topic) for the whole test case because most test cases use Topic and then the block form of repair_validations(<other_models>) inside any tests that use other models. Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixes validates_uniquness_of problem with case insensitive string containing ↵wmoxam2008-09-111-0/+7
| | | | | | newline characters Signed-off-by: Michael Koziarski <michael@koziarski.com>
* change activerecord validation tests to not use the deprecated interpolation ↵Sven Fuchs2008-09-101-29/+29
| | | | | | syntax any more Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Make case insensitive validates_uniqueness_of use unicode aware downcase method.Eugene Pimenov2008-08-291-0/+12
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* coerce blank strings to nil values for boolean and integer fieldsJosh Susser2008-08-221-4/+4
| | | | [#860 state:resolved]
* Revert "coerce blank strings to nil values for boolean and integer fields"Jeremy Kemper2008-08-211-4/+4
| | | | | | This reverts commit aee14630d4dc0856e597794cc731fac68c2d2e34. [#860 state:incomplete]
* coerce blank strings to nil values for boolean and integer fieldsJosh Susser2008-08-211-4/+4
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix file permissionsTarmo Tänav2008-07-311-0/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Ensure checked value is a string when validating case-sensitive uniqueness ↵Tom Ward2008-07-191-0/+9
| | | | | | [#361 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* merge forward to current rails/masterSven Fuchs2008-07-161-5/+18
|\
| * Allow Infinity (1.0/0.0) to pass validates_numericality_of. [#354 ↵Chris Cherry2008-07-091-5/+6
| | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Add :tokenizer option to validates_length_of. [#507 state:resolved]David Lowenfels2008-07-041-0/+12
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | silence deprecation warning during validations testSven Fuchs2008-06-231-1/+3
|/
* Substitute value into validates_format_of messageJohn D. Hume2008-05-311-0/+6
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix validates_uniqueness_of for SQL keywords [#23 state:resolved]Alex MacCaw2008-05-111-0/+8
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added block-setting of attributes for Base.create like Base.new already has ↵David Heinemeier Hansson2008-04-301-0/+16
| | | | (Adam Meehan) [#39 state:resolved]
* Use define_callbacks helper for ActiveRecord validations.Joshua Peek2008-04-201-9/+9
|
* Ruby 1.9 compat: work around YAML serialization error exposed by validations ↵Jeremy Kemper2008-04-011-17/+18
| | | | | | tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that validates_uniqueness_of works with with_scope. Closes #9235. ↵Pratik Naik2008-03-311-0/+10
| | | | | | [nik.wakelin, cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix case-sensitive validates_uniqueness_of. Closes #11366 [miloops]Jeremy Kemper2008-03-311-0/+24
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9160 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :message option to validates_numericality_of. Closes #11456 [miloops, ↵Jeremy Kemper2008-03-311-0/+14
| | | | | | mdempfle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that validates_size_of :within works in associations (closes #11295, ↵David Heinemeier Hansson2008-03-291-0/+14
| | | | | | #10019) [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9129 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* mark encodingJeremy Kemper2008-02-281-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8941 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add tests and documentation for allow_blank. Closes #10651 [blj]Michael Koziarski2008-01-261-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/railsJeremy Kemper2008-01-211-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Extract ActiveSupport::Callbacks from Active Record, test case setup and ↵Jeremy Kemper2008-01-191-1/+1
| | | | | | teardown, and ActionController::Dispatcher. Closes #10727. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8664 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix pathsJeremy Kemper2008-01-181-5/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move tests to casesJeremy Kemper2008-01-181-0/+1407
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de