diff options
author | Malcolm Locke <malc@wholemeal.co.nz> | 2018-10-29 10:26:22 +1300 |
---|---|---|
committer | Malcolm Locke <malc@wholemeal.co.nz> | 2018-10-29 15:12:29 +1300 |
commit | 20ea01bd649138c46460995a3e565471b8386945 (patch) | |
tree | 0f646417cd5deb79f5f4bb26dcf9042a0c679b0b /guides/source | |
parent | d3cf5d25fca91ee48097f10b1f34b2f8f852cb6a (diff) | |
download | rails-20ea01bd649138c46460995a3e565471b8386945.tar.gz rails-20ea01bd649138c46460995a3e565471b8386945.tar.bz2 rails-20ea01bd649138c46460995a3e565471b8386945.zip |
Document exception from restrict_with_exception [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/association_basics.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index 78a1f47407..f75517c5ab 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -1258,7 +1258,7 @@ Controls what happens to the associated object when its owner is destroyed: * `:destroy` causes the associated object to also be destroyed * `:delete` causes the associated object to be deleted directly from the database (so callbacks will not execute) * `:nullify` causes the foreign key to be set to `NULL`. Callbacks are not executed. -* `:restrict_with_exception` causes an exception to be raised if there is an associated record +* `:restrict_with_exception` causes an `ActiveRecord::DeleteRestrictionError` exception to be raised if there is an associated record * `:restrict_with_error` causes an error to be added to the owner if there is an associated object It's necessary not to set or leave `:nullify` option for those associations @@ -1659,7 +1659,7 @@ Controls what happens to the associated objects when their owner is destroyed: * `:destroy` causes all the associated objects to also be destroyed * `:delete_all` causes all the associated objects to be deleted directly from the database (so callbacks will not execute) * `:nullify` causes the foreign keys to be set to `NULL`. Callbacks are not executed. -* `:restrict_with_exception` causes an exception to be raised if there are any associated records +* `:restrict_with_exception` causes an `ActiveRecord::DeleteRestrictionError` exception to be raised if there are any associated records * `:restrict_with_error` causes an error to be added to the owner if there are any associated objects ##### `:foreign_key` |