check if id does not exist a bit more explicitly
if left as-is, ids with value of zero were treated as non-existent
This commit is contained in:
parent
517ea875ec
commit
2891b5e5b3
|
@ -361,7 +361,7 @@ DataAccessObject.updateOrCreate = DataAccessObject.upsert = function upsert(data
|
|||
var hookState = {};
|
||||
|
||||
var id = getIdValue(this, data);
|
||||
if (!id) {
|
||||
if (id === undefined || id === null) {
|
||||
return this.create(data, options, cb);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue