Skip to content

Commit

Permalink
generate id from key if item is found lacking
Browse files Browse the repository at this point in the history
  • Loading branch information
mshick committed Sep 13, 2014
1 parent bbcc1e0 commit 2868145
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/adapters/level/index.js
Expand Up @@ -199,6 +199,9 @@ utils.mixin(Adapter.prototype, new (function () {
if (filter(data)) {
inst = query.model.create(item.value, {scenario: query.opts.scenario});
inst.id = item.value.id;
if (!id) {
inst.id = item.key;
}
inst._saved = true;
res.push(inst);
}
Expand Down

0 comments on commit 2868145

Please sign in to comment.