diff options
author | claudiob <claudiob@gmail.com> | 2014-12-08 06:35:25 -0800 |
---|---|---|
committer | claudiob <claudiob@gmail.com> | 2015-01-02 15:31:56 -0800 |
commit | f767981286b4c7dcb96e061a6f3edcc334008ea8 (patch) | |
tree | 35afe22d27693178a1f0a08f20e36c7eeb5a9189 /activemodel/CHANGELOG.md | |
parent | d217daf6a740de7e4925872abe632982cfaab89b (diff) | |
download | rails-f767981286b4c7dcb96e061a6f3edcc334008ea8.tar.gz rails-f767981286b4c7dcb96e061a6f3edcc334008ea8.tar.bz2 rails-f767981286b4c7dcb96e061a6f3edcc334008ea8.zip |
Deprecate `false` as the way to halt AM validation callbacks
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)`.
Diffstat (limited to 'activemodel/CHANGELOG.md')
-rw-r--r-- | activemodel/CHANGELOG.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index b86e988841..562d49d069 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -1 +1,10 @@ +* Deprecate returning `false` as a way to halt callback chains. + + Returning `false` in a `before_` validation callback will display a + deprecation warning explaining that the preferred method to halt a callback + chain is to explicitly `throw(:abort)`. + + *claudiob* + + Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md) for previous changes. |