Skip to content

Commit e35960f

Browse files
committed
[ci skip]Revert commits changing wrong place
This reverts commits 5147ab1 and 391043a. These commits looked to intend to change documents of has_many dependent options, but actually changed documents of belongs_to dependent options.
1 parent d1281cd commit e35960f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

guides/source/association_basics.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -966,13 +966,12 @@ side of the association.
966966
Counter cache columns are added to the containing model's list of read-only attributes through `attr_readonly`.
967967

968968
##### `:dependent`
969-
Controls what happens to associated objects when their owner is destroyed:
969+
If you set the `:dependent` option to:
970970

971-
* `:destroy` causes the associated objects to also be destroyed.
972-
* `:delete_all` causes the associated objects to be deleted directly from the database (callbacks are not executed).
973-
* `:nullify` causes the foreign keys to be set to `NULL` (callbacks are not executed).
974-
* `:restrict_with_exception` causes an exception to be raised if there are associated records.
975-
* `:restrict_with_error` causes an error to be added to the owner if there are associated objects.
971+
* `:destroy`, when the object is destroyed, `destroy` will be called on its
972+
associated objects.
973+
* `:delete`, when the object is destroyed, all its associated objects will be
974+
deleted directly from the database without calling their `destroy` method.
976975

977976
WARNING: You should not specify this option on a `belongs_to` association that is connected with a `has_many` association on the other class. Doing so can lead to orphaned records in your database.
978977

0 commit comments

Comments
 (0)