lib/mongoid_nested_set/update.rb
def update_self_and_descendants_depth
      if depth?
        scope_class.each_with_level(self_and_descendants) do |node, level|
          node.with(:safe => true).set(:depth, level) unless node.depth == level
        end
        self.reload
      end
      self
    end
def update_self_and_descendants_depth
      if depth?
        scope_class.each_with_level(self_and_descendants) do |node, level|
          node.with(:safe => true).set(:depth, level) unless node.depth == level
        end
        self.reload
      end
      self
    end
Update cached level attribute for self and descendants