diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-30 00:16:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 00:16:30 +0900 |
commit | d7f48c9c39befaf23ccd63e0248a3bd5bf295ee5 (patch) | |
tree | e8c05ad3b1704d054721e9cf1202b7f48e7261b4 /guides | |
parent | 0d68e0690f449bf815c975c25d4d74917d3cad11 (diff) | |
parent | 20ea01bd649138c46460995a3e565471b8386945 (diff) | |
download | rails-d7f48c9c39befaf23ccd63e0248a3bd5bf295ee5.tar.gz rails-d7f48c9c39befaf23ccd63e0248a3bd5bf295ee5.tar.bz2 rails-d7f48c9c39befaf23ccd63e0248a3bd5bf295ee5.zip |
Merge pull request #34338 from malclocke/document_exception_class_for_restrict_with_exception
Document exception from restrict_with_exception [ci skip]
Diffstat (limited to 'guides')
-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` |