Fix a bug when validation is off for findOrCreate
This commit is contained in:
parent
174237e6a6
commit
2423db1571
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue