Fix a bug when validation is off for findOrCreate
This commit is contained in:
parent
1771bfabcc
commit
a5150265ec
|
@ -758,12 +758,12 @@ DataAccessObject.findOrCreate = function findOrCreate(query, data, options, cb)
|
||||||
|
|
||||||
// options has precedence on model-setting
|
// options has precedence on model-setting
|
||||||
if (options.validate === false) {
|
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
|
// only when options.validate is not set, take model-setting into consideration
|
||||||
if (options.validate === undefined && Model.settings.automaticValidation === false) {
|
if (options.validate === undefined && Model.settings.automaticValidation === false) {
|
||||||
_findOrCreate(query, data, obj);
|
return _findOrCreate(query, data, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// validation required
|
// validation required
|
||||||
|
|
Loading…
Reference in New Issue