aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-13 09:46:50 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-13 09:46:50 -0800
commit4f779e32d875209d917b01e4252ad34712178f26 (patch)
treed2497d590524530533ad7488fa83417060da6510
parent050f100d07e12466899c2ee04e3f8872b7e316f1 (diff)
parent25a96234220a0b0ba37934e62102ebc0be270431 (diff)
downloadrails-4f779e32d875209d917b01e4252ad34712178f26.tar.gz
rails-4f779e32d875209d917b01e4252ad34712178f26.tar.bz2
rails-4f779e32d875209d917b01e4252ad34712178f26.zip
Merge pull request #13699 from rystraum/dependent-restrict-removal
Updated Changelog to reflect removal of :dependent => :restrict
-rw-r--r--guides/source/upgrading_ruby_on_rails.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md
index bca1d36ab7..72a4bb4c2d 100644
--- a/guides/source/upgrading_ruby_on_rails.md
+++ b/guides/source/upgrading_ruby_on_rails.md
@@ -614,6 +614,10 @@ config.active_record.mass_assignment_sanitizer = :strict
Rails 3.2 deprecates `vendor/plugins` and Rails 4.0 will remove them completely. While it's not strictly necessary as part of a Rails 3.2 upgrade, you can start replacing any plugins by extracting them to gems and adding them to your Gemfile. If you choose not to make them gems, you can move them into, say, `lib/my_plugin/*` and add an appropriate initializer in `config/initializers/my_plugin.rb`.
+### Active Record
+
+Option `:dependent => :restrict` has been removed from `belongs_to`. If you want to prevent deleting the object if there are any associated objects, you can set `:dependent => :destroy` and return `false` after checking for existence of association from any of the associated object's destroy callbacks.
+
Upgrading from Rails 3.0 to Rails 3.1
-------------------------------------