diff options
author | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-09 11:32:53 +0200 |
---|---|---|
committer | Dennis Eriksen <dennis.se@gmail.com> | 2013-05-09 11:32:53 +0200 |
commit | 96b655d75539cab5d9b380875e3515bddcf3eb6d (patch) | |
tree | d45d2a5755e5d2f3c60412f189a9acd2fa0346e2 /models/Project.js | |
parent | changed the model (diff) | |
download | Divid-96b655d75539cab5d9b380875e3515bddcf3eb6d.tar.gz |
added new method for retrieving right project
Diffstat (limited to 'models/Project.js')
-rw-r--r-- | models/Project.js | 16 |
1 files changed, 15 insertions, 1 deletions
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); + } } |