lib/mongoid_nested_set/validation.rb
def left_and_rights_valid?
      all.detect { |node|
        node.send(left_field_name).nil? ||
          node.send(right_field_name).nil? ||
          node.send(left_field_name) >= node.send(right_field_name) ||
          !node.parent.nil? && (
            node.send(left_field_name) <= node.parent.send(left_field_name) ||
            node.send(right_field_name) >= node.parent.send(right_field_name)
        )
      }.nil?
    end
def left_and_rights_valid?
      all.detect { |node|
        node.send(left_field_name).nil? ||
          node.send(right_field_name).nil? ||
          node.send(left_field_name) >= node.send(right_field_name) ||
          !node.parent.nil? && (
            node.send(left_field_name) <= node.parent.send(left_field_name) ||
            node.send(right_field_name) >= node.parent.send(right_field_name)
        )
      }.nil?
    end
Warning: Very expensive!  Do not use unless you know what you are doing.