aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/callbacks_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Add test for AM::Validation::Callbacks with :onclaudiob2015-01-111-0/+26
| | | | | | | | | | | `before_validation` and `after_validation` from ActiveModel::Validation::Callbacks accept an optional `:on` parameter that was not previously documented or tested. For instance given before_validation :do_something, on: :create then `object.valid?(:create)` will invoke `:do_something` while `object.valid?` or `object.valid?(:anything_else)` will not.
* Deprecate `false` as the way to halt AM validation callbacksclaudiob2015-01-021-3/+17
| | | | | | | | | | Before this commit, returning `false` in an ActiveModel validation callback such as `before_validation` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
* Add AM test for after_validation returning falseclaudiob2014-12-141-2/+13
| | | | | | | | This stems from https://github.com/rails/rails/pull/17227#discussion_r21641358 It's simply a clarification of the current behavior by which if an `after_validation` ActiveModel callback returns +false+, then further `after_` callbacks **are not halted**.
* Added tests for if condition in Active Model callbacksNeeraj Singh2013-04-211-0/+21
|
* fix typo in callbacks testAccessd2012-07-241-2/+2
|
* Removing unwanted method and adding to accessor for getter historyprasath2012-01-251-4/+3
|
* Avoid method redefined warningSantiago Pastorino2010-06-221-1/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* ActiveModel::Validations::Callbacks should not be required by default.José Valim2010-06-191-0/+1
|
* moving before_validation and after_validation functionality from ↵Neeraj Singh2010-06-191-0/+76
ActiveRecord to ActiveModel [#4653 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>