Rails 祖先:如何获得位于子树的 n 深度的后代?

Rails Ancestry: How do I get descendants that are at depth of n of a subtree?

我有一个我感兴趣的后代节点。但我对在特定深度找到的后代感兴趣。我怎么做?

https://github.com/stefankroes/ancestry#selecting-nodes-by-depth

Use the at_depth(n)

n being the depth of the nodes that you want to return

Note: the depth begins with value 0```