From 2423db15717b707d0dce39295bbbfd10eae12711 Mon Sep 17 00:00:00 2001 From: Amir Jafarian Date: Wed, 6 Jan 2016 17:24:07 -0500 Subject: [PATCH] Fix a bug when validation is off for findOrCreate --- lib/dao.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dao.js b/lib/dao.js index f4929317..4b6fefa2 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -757,12 +757,12 @@ DataAccessObject.findOrCreate = function findOrCreate(query, data, options, cb) // options has precedence on model-setting if (options.validate === false) { - _findOrCreate(query, data, obj); + return _findOrCreate(query, data, obj); } // only when options.validate is not set, take model-setting into consideration if (options.validate === undefined && Model.settings.automaticValidation === false) { - _findOrCreate(query, data, obj); + return _findOrCreate(query, data, obj); } // validation required