[Persistence] Parse out key

When an identifier is a space-key pair, parse out the key before
persisting.
This commit is contained in:
Victor Woeltjen 2015-11-05 17:58:16 -08:00
parent 0a9c162f26
commit d69cf6c6fe

View File

@ -63,6 +63,11 @@ define(
};
}
function getKey(id) {
var parts = id.split(":");
return parts.length > 1 ? parts.slice(1).join(":") : id;
}
/**
* Persist any changes which have been made to this
* domain object's model.
@ -87,7 +92,7 @@ define(
// ...and persist
return persistenceFn.apply(persistenceService, [
this.getSpace(),
domainObject.getId(),
getKey(domainObject.getId()),
domainObject.getModel()
]);
};