From ad97778af3d3455e55b69da0b5953f01263ed7e0 Mon Sep 17 00:00:00 2001 From: Diogo Resende Date: Thu, 8 Aug 2013 22:20:52 +0100 Subject: [PATCH] Adds instance.model() to get the model of an instance (#293) --- lib/Instance.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Instance.js b/lib/Instance.js index 82156d38..c781e745 100755 --- a/lib/Instance.js +++ b/lib/Instance.js @@ -550,6 +550,12 @@ function Instance(Model, opts) { }, enumerable: false }); + Object.defineProperty(instance, "model", { + value: function (cb) { + return Model; + }, + enumerable: false + }); for (var i = 0; i < opts.id.length; i++) { if (!opts.data.hasOwnProperty(opts.id[i])) {