[Persistence] Add in-line documentation

Add clarifying comments to reflect changes to
procedure used for loading models from persistence
introduced in support of reducing latency in loading
domain objects introduced by the WARP Server adapter,
WTD-644.
This commit is contained in:
Victor Woeltjen 2015-01-12 09:32:25 -08:00
parent 63990b5e13
commit 11f6175592

View File

@ -22,10 +22,14 @@ define(
function PersistedModelProvider(persistenceService, $q, SPACE) {
function promiseModels(ids) {
return $q.all(ids.filter(function (id) {
// Filter out "namespaced" identifiers; these are
// not expected to be found in database. See WTD-659.
return id.indexOf(":") === -1;
}).map(function (id) {
// Read remaining objects from persistence
return persistenceService.readObject(SPACE, id);
})).then(function (models) {
// Packaged the result as id->object
var result = {};
ids.forEach(function (id, index) {
result[id] = models[index];