Returns list of all root nodes (those with no parent nodes).
TreeClass.roots # => [root1, root2]
# File lib/sequel/plugins/tree.rb, line 67 def roots roots_dataset.all end
Returns the dataset for retrieval of all root nodes
TreeClass.roots_dataset # => Sequel::Dataset instance
# File lib/sequel/plugins/tree.rb, line 74 def roots_dataset ds = where(Sequel.or(Array(parent_column).zip([]))) ds = ds.order(*tree_order) if tree_order ds end
Generated with the Darkfish Rdoc Generator 2.