def sibling_of?(other, options = {})
      scopes              = options[:scope]               || self.default_sibling_scope
      scope_values        = options[:scope_values]        || {}
      other_scope_values  = options[:other_scope_values]  || {}

      scopes = Array.wrap(scopes).compact


      return false if base_document_class != base_document_class(other)

      scopes.each do |scope|
        scope_value       = scope_values.fetch(scope)       { self.send(scope) }
        other_scope_value = other_scope_values.fetch(scope) { other.send(scope) }

        return false if scope_value != other_scope_value
      end
      
      true
    end
def sibling_of?(other, options = {})
      scopes              = options[:scope]               || self.default_sibling_scope
      scope_values        = options[:scope_values]        || {}
      other_scope_values  = options[:other_scope_values]  || {}

      scopes = Array.wrap(scopes).compact


      return false if base_document_class != base_document_class(other)

      scopes.each do |scope|
        scope_value       = scope_values.fetch(scope)       { self.send(scope) }
        other_scope_value = other_scope_values.fetch(scope) { other.send(scope) }

        return false if scope_value != other_scope_value
      end
      
      true
    end
Is this document a sibling of the other document?

 @example Is this document a sibling of the other document?
   book.sibling_of?(other_book, scope: :author)

 @param [ Document ] other The document to check against.
 @param [ Hash ] options The options.

 @option options [ Array<Symbol>, Symbol ] scope One or more relations and
   attributes that siblings of this object need to have in common.
 @option options [ Hash<Symbol, Object> ] scope_values Optional alternative
   values for this document to use to determine siblings.
 @option options [ Hash<Symbol, Object> ] other_scope_values Optional
   alternative values for the other document to use to determine
   siblingship.

 @return [ Boolean ] True if the document is a sibling of the other
   document.