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:
Pulkit Singhal 2015-03-30 09:52:08 -05:00
parent 517ea875ec
commit 2891b5e5b3
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}