Skip to content

Commit d8dee0a

Browse files
committed
Fix infinite loop in save (dresende#279)
1 parent 0516c6f commit d8dee0a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎lib/Instance.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,12 @@ function Instance(Model, opts) {
118118
}
119119

120120
if (opts.changes.length === 0) {
121-
return saveAssociations(function (err) {
122-
return afterSave(cb, false, err);
123-
});
121+
if (saveOptions.saveAssociations === false) {
122+
return saveInstanceExtra(cb);
123+
}
124+
return saveAssociations(function (err) {
125+
return afterSave(cb, false, err);
126+
});
124127
}
125128

126129
return savePersisted(cb, saveOptions, getInstanceData());

0 commit comments

Comments
 (0)