Module: Sequel::Plugins::Tree::ClassMethods

Defined in:
lib/sequel/plugins/tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#children_association_nameObject (readonly)

The association name for the children association



75
76
77
# File 'lib/sequel/plugins/tree.rb', line 75

def children_association_name
  @children_association_name
end

#parent_association_nameObject (readonly)

The association name for the parent association



72
73
74
# File 'lib/sequel/plugins/tree.rb', line 72

def parent_association_name
  @parent_association_name
end

#parent_columnObject

The symbol or array of symbols for the column containing the value pointing to the parent of the node.



65
66
67
# File 'lib/sequel/plugins/tree.rb', line 65

def parent_column
  @parent_column
end

#qualified_parent_columnObject

The qualified identifier or array of qualified identifiers for the column containing the value pointing to the parent of the node.



69
70
71
# File 'lib/sequel/plugins/tree.rb', line 69

def qualified_parent_column
  @qualified_parent_column
end

#tree_orderObject

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



61
62
63
# File 'lib/sequel/plugins/tree.rb', line 61

def tree_order
  @tree_order
end

Instance Method Details

#freezeObject

Should freeze tree order if it is an array when freezing the model class.



81
82
83
84
85
# File 'lib/sequel/plugins/tree.rb', line 81

def freeze
  @tree_order.freeze if @tree_order.is_a?(Array)

  super
end