diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 1171b998..15d78da6 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -1699,9 +1699,7 @@ EmbedsMany.prototype.updateById = function (fkId, data, cb) { if (inst instanceof modelTo) { if (typeof data === 'object') { - for (var key in data) { - inst[key] = data[key]; - } + inst.setAttributes(data); } var err = inst.isValid() ? null : new ValidationError(inst); if (err && typeof cb === 'function') {