From 96b655d75539cab5d9b380875e3515bddcf3eb6d Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Thu, 9 May 2013 11:32:53 +0200 Subject: added new method for retrieving right project --- models/Project.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'models/Project.js') diff --git a/models/Project.js b/models/Project.js index f29c7f8..2779575 100644 --- a/models/Project.js +++ b/models/Project.js @@ -59,8 +59,22 @@ ProjectSchema.statics = { this.findOne({ _id: id }) .populate('user') .exec(callback); - } + }, + + + /** + * Find project my shortURL + * + * @param {shortURL} shortURL + * @param {Function} callback + * @api private + */ + loadShort : function(shortURL, callback) { + this.findOne({ shortURL: shortURL }) + .populate('user') + .exec(callback); + } } -- cgit v1.2.3