diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-08-10 12:33:51 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-08-10 17:45:06 +0100 |
commit | 5ad79989ef0a015fd22cfed90b2e8a56881e6c36 (patch) | |
tree | 8840456df7fb008c3306dae389f7cd73ec531977 /activerecord/CHANGELOG.md | |
parent | d1835db6b5efce31af935aa804c7b537e14764d2 (diff) | |
download | rails-5ad79989ef0a015fd22cfed90b2e8a56881e6c36.tar.gz rails-5ad79989ef0a015fd22cfed90b2e8a56881e6c36.tar.bz2 rails-5ad79989ef0a015fd22cfed90b2e8a56881e6c36.zip |
Remove the dependent_restrict_raises option.
It's not really a good idea to have this as a global config option. We
should allow people to specify the behaviour per association.
There will now be two new values:
* :dependent => :restrict_with_exception implements the current
behaviour of :restrict. :restrict itself is deprecated in favour of
:restrict_with_exception.
* :dependent => :restrict_with_error implements the new behaviour - it
adds an error to the owner if there are dependent records present
See #4727 for the original discussion of this.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index a99d7fdde8..e6237ef437 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -486,24 +486,13 @@ * Added the `ActiveRecord::NullRelation` class implementing the null object pattern for the Relation class. *Juanjo Bazán* -* Added deprecation for the `:dependent => :restrict` association option. +* Added new `:dependent => :restrict_with_error` option. This will add + an error to the model, rather than raising an exception. - Please note: - - * Up until now `has_many` and `has_one`, `:dependent => :restrict` - option raised a `DeleteRestrictionError` at the time of destroying - the object. Instead, it will add an error on the model. - - * To fix this warning, make sure your code isn't relying on a - `DeleteRestrictionError` and then add - `config.active_record.dependent_restrict_raises = false` to your - application config. - - * New rails application would be generated with the - `config.active_record.dependent_restrict_raises = false` in the - application config. + The `:restrict` option is renamed to `:restrict_with_exception` to + make this distinction explicit. - *Manoj Kumar* + *Manoj Kumar & Jon Leighton* * Added `create_join_table` migration helper to create HABTM join tables |