Merge pull request #601 from slonoed/master

Fix ReferenceError: definition is not defined
This commit is contained in:
Raymond Feng 2015-05-22 08:13:50 -07:00
commit 949054334c
1 changed files with 1 additions and 0 deletions

View File

@ -1753,6 +1753,7 @@ HasOne.prototype.destroy = function (options, cb) {
options = {}; options = {};
} }
cb = cb || utils.createPromiseCallback(); cb = cb || utils.createPromiseCallback();
var definition = this.definition;
this.fetch(function(err, targetModel) { this.fetch(function(err, targetModel) {
if (targetModel instanceof ModelBaseClass) { if (targetModel instanceof ModelBaseClass) {
targetModel.destroy(options, cb); targetModel.destroy(options, cb);