aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/validates_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix `CustomCops/AssertNot` to allow it to have failure messageRyuta Kamizono2018-05-131-1/+1
| | | | Follow up of #32605.
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-11/+11
|
* Add cases to test combining validation conditionsbogdanvlviv2017-11-061-3/+9
| | | | | | | | | - Test condition that is defined by array of conditions - Test condition that is defined by combining :if and :unless - Test local condition that is defined by :if - Test local condition that is defined by :unless See http://edgeguides.rubyonrails.org/active_record_validations.html#combining-validation-conditions
* Use frozen string literal in activemodel/Kir Shatrov2017-07-161-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* modernizes hash syntax in activemodelXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in activemodel/testXavier Noria2016-08-061-24/+24
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Remove redundant require of fileAdam892014-11-011-1/+0
| | | | | This file was required inside 'test/validators/namespace/email_validator.rb' that's already required here. Therefore I removed the redundant required.
* Use the new clear_validators! api to reset validators in testsCarlos Antonio da Silva2014-01-271-3/+3
|
* 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' ).
* convert comments to 1.9 hash syntaxAvnerCohen2012-10-221-1/+1
|
* confirmation validation error attributeBrian Cardarella2012-04-231-1/+1
| | | | | | | | | | | | This will render the error message on :#{attribute}_confirmation instead of on attribute itself. When rendering confirmation errors inline on the form with form builders such as SimpleForm and Formtastic it is confusing to the ender user to see the confirmation error message on the attribute element. Instead it makes more sense to have this validation error render on the confirmation field instead. The i18n message has been updated for the confirmation validator error message to include the original attribute name.
* Fixed test "ArgumentError: wrong number of arguments(1 for 0)"Arun Agrawal2011-12-171-1/+1
|
* Fixed bug when error message is an empty string.Antonio Roberto2011-12-161-0/+6
|
* Provide a way to specify alternate option keys for validatesCarl Lerche2011-02-051-0/+11
|
* Do not require that validation attributes be specified as symbolsCarl Lerche2011-02-051-0/+11
|
* Add support for namespaced validatorsSamuel Kadolph2010-12-161-0/+8
| | | | | | Includes test and documentation for new feature Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Better shortcut options for custom validators [#5672 state:resolved]Obie Fernandez2010-09-241-0/+9
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-4/+4
| | | | 's/[ \t]*$//' -i {} \;)
* Make use of assert_equal to test equallity between object assert expects and ↵Santiago Pastorino2010-05-161-2/+2
| | | | | | | | object and a message of error [#4611 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix typo by renaming :genre to :gender.José Valim2010-01-091-6/+6
|
* 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
* 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-071-0/+53
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>