Skip to content

Commit 25bf8c0

Browse files
committed
Clarify :dependent option when you don't want to act on descendant nodes upon parent deletion.
I was looking for a way to do this and ended up having to try by myself.
1 parent 6a67e3a commit 25bf8c0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ When you include ```has_closure_tree``` in your model, you can provide a hash to
281281
* ```:nullify``` will simply set the parent column to null. Each child node will be considered a "root" node. This is the default.
282282
* ```:delete_all``` will delete all descendant nodes (which circumvents the destroy hooks)
283283
* ```:destroy``` will destroy all descendant nodes (which runs the destroy hooks on each child node)
284+
* ```nil``` does nothing with descendant nodes
284285
* ```:name_column``` used by #```find_or_create_by_path```, #```find_by_path```, and ```ancestry_path``` instance methods. This is primarily useful if the model only has one required field (like a "tag").
285286
* ```:order``` used to set up [deterministic ordering](#deterministic-ordering)
286287
* ```:touch``` delegates to the `belongs_to` annotation for the parent, so `touch`ing cascades to all children (the performance of this for deep trees isn't currently optimal).

0 commit comments

Comments
 (0)