From 69cc091ef458d8d9ced04758634982131487c7d7 Mon Sep 17 00:00:00 2001 From: Amir Jafarian Date: Fri, 22 Jul 2016 20:14:06 -0400 Subject: [PATCH] Declare `definition` * Declare `definition` in `BelongsTo.prototype.destroy` Backport loopback-datasource-juggler#1009 --- lib/relation-definition.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 7e33b814..f41ca72e 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -1364,9 +1364,10 @@ BelongsTo.prototype.destroy = function(options, cb) { cb = options; options = {}; } - var modelTo = this.definition.modelTo; + + var definition = this.definition; var modelInstance = this.modelInstance; - var fk = this.definition.keyFrom; + var fk = definition.keyFrom; cb = cb || utils.createPromiseCallback();