Only update id if it does not present in resulting dataset
This commit is contained in:
parent
c08a220dda
commit
e8ef71c431
|
@ -286,7 +286,9 @@ AbstractClass.find = function find(id, cb) {
|
|||
this.schema.adapter.find(this.modelName, id, function (err, data) {
|
||||
var obj = null;
|
||||
if (data) {
|
||||
data.id = id;
|
||||
if (!data.id) {
|
||||
data.id = id;
|
||||
}
|
||||
obj = new this();
|
||||
obj._initProperties(data, false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue