Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Ensure numericality validations work with mutation | Sean Griffin | 2014-12-01 | 1 | -0/+13 |
| | | | | | | | | | | | | | | | | | | | | | The detection of in-place changes caused a weird unexpected issue with numericality validations. That validator (out of necessity) works on the `_before_type_cast` version of the attribute, since on an `:integer` type column, a non-numeric string would type cast to 0. However, strings are mutable, and we changed strings to ensure that the post type cast version of the attribute was a different instance than the before type cast version (so the mutation detection can work properly). Even though strings are the only mutable type for which a numericality validation makes sense, special casing strings would feel like a strange change to make here. Instead, we can make the assumption that for all mutable types, we should work on the post-type-cast version of the attribute, since all cases which would return 0 for non-numeric strings are immutable. Fixes #17852 | ||||
* | Build fix when running in isolation | Arun Agrawal | 2014-11-14 | 1 | -0/+1 |
| | | | | | `Computer` class needs to be require See #17217 for more details | ||||
* | Add AR::Base#validate! method | Bogdan Gusiev | 2014-06-23 | 1 | -0/+14 |
| | | | | | Acts same as valid? but raises AR::RecordInvalid exception if validation fails | ||||
* | Merge pull request #10662 from ↵ | Carlos Antonio da Silva | 2014-05-11 | 1 | -9/+9 |
|\ | | | | | | | | | take/change-test-name-for-ActiveRecord--Validations#valid- Refactor AR's validations_test.rb | ||||
| * | Refactor AR's validations_test.rb | Takehiro Adachi | 2013-12-03 | 1 | -9/+9 |
| | | | | | | | | | | | | | | | | | | | | The `:context` switch feature is implemented in ActiveRecord::Validations#valid? method, so we should rename the test names, and execute `valid?` in the test. Change test name in AR's validations_test.rb This test is testing save method's code | ||||
* | | ActiveRecord/ActiveModel '#validate' alias for 'valid?' | Henrik Nyh | 2014-03-27 | 1 | -0/+15 |
| | | | | | | | | | | | | | | | | It's unintuitive to call '#valid?' when you want to run validations but don't care about the return value. The alias in ActiveRecord isn't strictly necessary (the ActiveModel alias is still in effect), but it clarifies. | ||||
* | | Prefer assert_raise instead of flunk + rescue to test for exceptions | Carlos Antonio da Silva | 2013-12-19 | 1 | -5/+3 |
|/ | | | | | | Change most tests to make use of assert_raise returning the raised exception rather than relying on a combination of flunk + rescue to check for exception types/messages. | ||||
* | Typo fixes [ci skip] | Akshay Vishnoi | 2013-11-30 | 1 | -1/+1 |
| | |||||
* | Remove mass assignment security from ActiveRecord | Guillermo Iguaran | 2012-09-16 | 1 | -6/+0 |
| | |||||
* | remove tests for #with_scope (it's now deprecated) | Jon Leighton | 2012-04-25 | 1 | -24/+0 |
| | |||||
* | Deprecate set_table_name in favour of self.table_name= or defining your own ↵ | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | | | | method. | ||||
* | please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT | Aaron Patterson | 2011-06-06 | 1 | -1/+1 |
| | |||||
* | Refactor Active Record test connection setup. Please see the ↵ | Jon Leighton | 2011-06-04 | 1 | -1/+1 |
| | | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. | ||||
* | Cleanup deprecation warnings in active record | Carlos Antonio da Silva | 2010-09-06 | 1 | -43/+0 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | removing unused models from tests | Subba Rao Pasupuleti | 2010-07-21 | 1 | -5/+0 |
| | | | | | | [#5153 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Validators should at model level and not at AR:Base level [Closes #4804] | Neeraj Singh | 2010-06-10 | 1 | -0/+10 |
| | | | | | | [#4804 state:resolved] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com> | ||||
* | Fix failing test. | José Valim | 2010-05-21 | 1 | -6/+6 |
| | |||||
* | Replace assert with assert_equal in some test cases | Neeraj Singh | 2010-05-21 | 1 | -2/+2 |
| | | | | | | [#4654 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Remove undocumented save_without_validation! | Pratik Naik | 2010-05-11 | 1 | -6/+0 |
| | |||||
* | Make sure valid? preceives the context as in ActiveModel API (ht: Carlos ↵ | José Valim | 2010-05-10 | 1 | -0/+17 |
| | | | | Antonio) | ||||
* | updated AR to work with the AMo model validation changes | Josh Kalderimis | 2010-05-08 | 1 | -1/+1 |
| | |||||
* | test_validates_acceptance_of_as_database_column fixed | Santiago Pastorino | 2010-02-05 | 1 | -3/+3 |
| | | | | | | [#3826 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | Ensure deprecated validate methods are invoked when they are private [#3214 ↵ | José Valim | 2010-01-18 | 1 | -1/+18 |
| | | | | status:resolved] | ||||
* | save(false) is gone, use save(:validate => false) instead. | José Valim | 2010-01-17 | 1 | -1/+9 |
| | |||||
* | Simplify repair_validations on AR and make it work with new callbacks. | José Valim | 2010-01-01 | 1 | -14/+14 |
| | |||||
* | Don't publicize with_scope for tests since it may shadow public misuse | Jeremy Kemper | 2009-12-28 | 1 | -3/+3 |
| | |||||
* | Move validator, human_name and human_attribute_name to ActiveModel, remove ↵ | José Valim | 2009-10-20 | 1 | -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 message | Akira Matsuda | 2009-09-11 | 1 | -3/+6 |
| | | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | Changed ActiveRecord to use new callbacks and speed up observers by only ↵ | José Valim | 2009-09-08 | 1 | -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 Naik | 2009-03-21 | 1 | -0/+34 |
| | | | | Model.validate :method and likewise | ||||
* | Deprecate Errors#on_base/add_to_base/invalid?/each_full | Pratik Naik | 2009-03-21 | 1 | -2/+2 |
| | |||||
* | Add ActiveModel::Validations tests for regular ruby classes | Pratik Naik | 2009-03-20 | 1 | -0/+9 |
| | |||||
* | Add I18n translations to ActiveModel and move more AR specific parts to ↵ | Pratik Naik | 2009-03-20 | 1 | -0/+12 |
| | | | | ActiveRecord::Validations | ||||
* | Deprecate Error#on(attribute) in favour of Errors#[attribute] | Pratik Naik | 2009-03-20 | 1 | -2/+2 |
| | |||||
* | Move relevant validation tests from Active Record to Active Model | Pratik Naik | 2009-03-20 | 1 | -1469/+1 |
| | |||||
* | Move all the Active Record validations to Active Model | Pratik Naik | 2009-03-19 | 1 | -125/+123 |
| | |||||
* | Ruby 1.9 compat: rename deprecated assert_raises to assert_raise. | Jeremy Kemper | 2009-03-08 | 1 | -6/+6 |
| | | | | [#1617 state:resolved] | ||||
* | Add ActiveRecord::Base#invalid? as the opposite of #valid? [#2159 ↵ | Jeffrey Hardy | 2009-03-08 | 1 | -1/+12 |
| | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Ensure validates_uniqueness_of considers limit on the field. [#1042 ↵ | Arthur Klepchukov | 2009-03-07 | 1 | -0/+9 |
| | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | DRY with_kcode in Active Record tests | Pratik Naik | 2009-03-07 | 1 | -14/+0 |
| | |||||
* | validate_length_of should use custom message if given when using in or within. | miloops | 2009-02-01 | 1 | -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 Steele | 2008-12-19 | 1 | -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 ↵ | wmoxam | 2008-09-11 | 1 | -0/+7 |
| | | | | | | newline characters Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | change activerecord validation tests to not use the deprecated interpolation ↵ | Sven Fuchs | 2008-09-10 | 1 | -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 Pimenov | 2008-08-29 | 1 | -0/+12 |
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | coerce blank strings to nil values for boolean and integer fields | Josh Susser | 2008-08-22 | 1 | -4/+4 |
| | | | | [#860 state:resolved] | ||||
* | Revert "coerce blank strings to nil values for boolean and integer fields" | Jeremy Kemper | 2008-08-21 | 1 | -4/+4 |
| | | | | | | This reverts commit aee14630d4dc0856e597794cc731fac68c2d2e34. [#860 state:incomplete] | ||||
* | coerce blank strings to nil values for boolean and integer fields | Josh Susser | 2008-08-21 | 1 | -4/+4 |
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | Fix file permissions | Tarmo Tänav | 2008-07-31 | 1 | -0/+0 |
| | | | | Signed-off-by: Joshua Peek <josh@joshpeek.com> | ||||
* | Ensure checked value is a string when validating case-sensitive uniqueness ↵ | Tom Ward | 2008-07-19 | 1 | -0/+9 |
| | | | | | | [#361 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> |