From a5150265ec728b0fb2415a3de5c304064d24130b 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 70355dee..ffa47265 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -758,12 +758,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