From a6ff4b0cadc36aeb9233422a28b35c5dbe7b3801 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Mon, 9 Jun 2014 15:00:15 -0700 Subject: [PATCH] Use constructor to reference the model class --- lib/models/user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/models/user.js b/lib/models/user.js index f7e114d3..48a15eea 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -136,7 +136,8 @@ var User = module.exports = Model.extend('User', properties, options); * @param {AccessToken} token The generated access token object */ User.prototype.createAccessToken = function(ttl, cb) { - ttl = Math.min(ttl || User.settings.ttl, User.settings.maxTTL); + var userModel = this.constructor; + ttl = Math.min(ttl || userModel.settings.ttl, userModel.settings.maxTTL); this.accessTokens.create({ ttl: ttl }, cb);