Fix ReferenceError: definition is not defined
occure when try to delete object in has one relation, but object not created yet
This commit is contained in:
parent
12dea6e1cb
commit
91b04655cd
|
@ -1753,6 +1753,7 @@ HasOne.prototype.destroy = function (options, cb) {
|
|||
options = {};
|
||||
}
|
||||
cb = cb || utils.createPromiseCallback();
|
||||
var definition = this.definition;
|
||||
this.fetch(function(err, targetModel) {
|
||||
if (targetModel instanceof ModelBaseClass) {
|
||||
targetModel.destroy(options, cb);
|
||||
|
|
Loading…
Reference in New Issue