func (n *Note) MergeImport(i interface{}) (bool, error) {
	existing := i.(*Note)
	if n.ID != existing.ID {
		return false, errors.New("IDs don't match")
	}
	if n.Imported.IsZero() || existing.Imported.IsZero() {
		return false, errors.New("not an import")
	}
	if !n.Created.Equal(existing.Created) {
		return false, errors.New("Created timestamps don't match")
	}
	n.Rev = existing.Rev
	if n.Modified.After(existing.Modified) {
		// The new version is newer than the existing one, so update
		return true, nil
	}
	// The new version is older, so we need to use the version we just read
	n.Modified = existing.Modified
	n.Imported = existing.Imported
	n.ModelID = existing.ModelID
	n.FieldValues = existing.FieldValues
	n.Attachments = existing.Attachments
	n.Model = existing.Model
	return false, nil
}
// MergeImport attempts to merge i into n, returning true if successful, or
// false if no merge was necessary.
MergeImport attempts to merge i into n, returning true if successful, or
false if no merge was necessary.
// MergeImport attempts to merge i into n returning true if successful or // false if no merge was necessary .
func (n *Note) MergeImport(i interface{}) (bool, error) {
	existing := i.(*Note)
	if n.ID != existing.ID {
		return false, errors.New("IDs don't match")
	}
	if n.Imported.IsZero() || existing.Imported.IsZero() {
		return false, errors.New("not an import")
	}
	if !n.Created.Equal(existing.Created) {
		return false, errors.New("Created timestamps don't match")
	}
	n.Rev = existing.Rev
	if n.Modified.After(existing.Modified) {
		return true, nil
	}
	n.Modified = existing.Modified
	n.Imported = existing.Imported
	n.ModelID = existing.ModelID
	n.FieldValues = existing.FieldValues
	n.Attachments = existing.Attachments
	n.Model = existing.Model
	return false, nil
}
func ( n * Note ) MergeImport ( i interface { } ) ( bool , error ) { existing := i . ( * Note ) if n . ID != existing . ID { return false , errors . New ( " " ) } if n . Imported . IsZero ( ) || existing . Imported . IsZero ( ) { return false , errors . New ( " " ) } if ! n . Created . Equal ( existing . Created ) { return false , errors . New ( " " ) } n . Rev = existing . Rev if n . Modified . After ( existing . Modified ) { return true , nil } n . Modified = existing . Modified n . Imported = existing . Imported n . ModelID = existing . ModelID n . FieldValues = existing . FieldValues n . Attachments = existing . Attachments n . Model = existing . Model return false , nil }
MergeImport attempts to merge i into n, returning true if successful, or
false if no merge was necessary.
MergeImport attempts to merge i into n returning true if successful or false if no merge was necessary .
// The new version is newer than the existing one, so update // The new version is older, so we need to use the version we just read