def root
      if parent_ids.present?
        base_class.find(parent_ids.first)
      else
        self.root? ? self : self.parent.root
      end
    end
def root
      if parent_ids.present?
        base_class.find(parent_ids.first)
      else
        self.root? ? self : self.parent.root
      end
    end
Returns this document's root node. Returns `self` if the
 current document is a root node

 @example
   node = Node.find(...)
   node.root

 @return [Mongoid::Document] The documents root node