Module: Sequel::Plugins::Tree::ClassMethods
- Defined in:
- lib/sequel_tree.rb
Instance Method Summary collapse
-
#roots ⇒ Object
Returns list of all root nodes (those with no parent nodes).
-
#roots_dataset ⇒ Object
Returns the dataset for retrieval of all root nodes.
Instance Method Details
#roots ⇒ Object
Returns list of all root nodes (those with no parent nodes).
TreeClass.roots # => [root1, root2]
37 38 39 |
# File 'lib/sequel_tree.rb', line 37 def roots roots_dataset.all end |
#roots_dataset ⇒ Object
Returns the dataset for retrieval of all root nodes
TreeClass.roots_dataset => Sequel#Dataset
44 45 46 |
# File 'lib/sequel_tree.rb', line 44 def roots_dataset filter(@parent_column => nil).order(@order_column) end |