| Module | Sequel::Plugins::Tree::ClassMethods |
| In: |
lib/sequel/plugins/tree.rb
|
| parent_column | [RW] | The symbol for the column containing the value pointing to the parent of the leaf. |
| tree_order | [RW] | The column symbol or array of column symbols on which to order the tree. |
Copy the parent_column and order_column to the subclass.
# File lib/sequel/plugins/tree.rb, line 59
59: def inherited(subclass)
60: super
61: subclass.parent_column = parent_column
62: subclass.tree_order = tree_order
63: end
Returns list of all root nodes (those with no parent nodes).
TreeClass.roots # => [root1, root2]
# File lib/sequel/plugins/tree.rb, line 68
68: def roots
69: roots_dataset.all
70: end