Merge pull request #221 from fabien/fix/updateAttributes
Handle toObject in updateAttributes
This commit is contained in:
commit
97306037e3
|
@ -1175,6 +1175,10 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, cb
|
|||
// Convert the properties by type
|
||||
inst[key] = data[key];
|
||||
typedData[key] = inst[key];
|
||||
if (typeof typedData[key] === 'object'
|
||||
&& typeof typedData[key].toObject === 'function') {
|
||||
typedData[key] = typedData[key].toObject();
|
||||
}
|
||||
}
|
||||
|
||||
inst._adapter().updateAttributes(model, getIdValue(inst.constructor, inst),
|
||||
|
|
Loading…
Reference in New Issue