aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/models/Project.js
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-09 11:32:53 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-09 11:32:53 +0200
commit96b655d75539cab5d9b380875e3515bddcf3eb6d (patch)
treed45d2a5755e5d2f3c60412f189a9acd2fa0346e2 /models/Project.js
parentchanged the model (diff)
downloadDivid-96b655d75539cab5d9b380875e3515bddcf3eb6d.tar.gz
added new method for retrieving right project
Diffstat (limited to 'models/Project.js')
-rw-r--r--models/Project.js16
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);
+ }
}