Tiny fix: use setAttributes
This commit is contained in:
parent
c3f7a7acb5
commit
93fab448bc
|
@ -1699,9 +1699,7 @@ EmbedsMany.prototype.updateById = function (fkId, data, cb) {
|
||||||
|
|
||||||
if (inst instanceof modelTo) {
|
if (inst instanceof modelTo) {
|
||||||
if (typeof data === 'object') {
|
if (typeof data === 'object') {
|
||||||
for (var key in data) {
|
inst.setAttributes(data);
|
||||||
inst[key] = data[key];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var err = inst.isValid() ? null : new ValidationError(inst);
|
var err = inst.isValid() ? null : new ValidationError(inst);
|
||||||
if (err && typeof cb === 'function') {
|
if (err && typeof cb === 'function') {
|
||||||
|
|
Loading…
Reference in New Issue