Merge pull request #210 from fabien/fix/embeds-many

Tiny fix: use setAttributes
This commit is contained in:
Miroslav Bajtoš 2014-08-14 18:55:00 +02:00
commit 12514b01d0
1 changed files with 1 additions and 3 deletions

View File

@ -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') {