Class Index [+]

Quicksearch

Sequel::Plugins::Tree::ClassMethods

Attributes

tree_order[RW]

The column symbol or array of column symbols on which to order the tree.

parent_column[RW]

The symbol for the column containing the value pointing to the parent of the leaf.

Public Instance Methods

inherited(subclass) click to toggle source

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
roots() click to toggle source

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
roots_dataset() click to toggle source

Returns the dataset for retrieval of all root nodes

  TreeClass.roots_dataset => Sequel#Dataset
    # File lib/sequel/plugins/tree.rb, line 75
75:         def roots_dataset
76:           ds = filter(parent_column => nil)
77:           ds = ds.order(*tree_order) if tree_order
78:           ds
79:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.