lib/onoma/item.rb
# Computes left/right value for nested set
# Returns right index
Computes left/right value for nested set
Returns right index
Computes left / right value for nested set Returns right index
def rebuild_tree(left = 0, depth = 0)
      @depth = depth
      @left = left
      @right = @left + 1
      children(index: false, recursively: false).each do |child|
        @right = child.rebuild_tree(@right, @depth + 1) + 1
      end
      @right
    end
def rebuild_tree ( left = 0 , depth = 0 ) @depth = depth @left = left @right = @left + 1 children ( index : false , recursively : false ) . each do | child | @right = child . rebuild_tree ( @right , @depth + 1 ) + 1 end @right end
Computes left/right value for nested set
Returns right index
Computes left / right value for nested set Returns right index
left
<not_specific>
depth
<not_specific>