diff options
Diffstat (limited to '')
-rw-r--r-- | models/Project.js | 22 | ||||
-rw-r--r-- | models/pPost.js | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/models/Project.js b/models/Project.js index f29c7f8..ba0e8e7 100644 --- a/models/Project.js +++ b/models/Project.js @@ -41,12 +41,6 @@ ProjectSchema.pre('save', function(next) { ProjectSchema.statics = { - log: function() { - console.log('wat. wat logged this'); - }, - - - /** * Find project by id * @@ -59,8 +53,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); + } } diff --git a/models/pPost.js b/models/pPost.js index 5ec28b1..c02f863 100644 --- a/models/pPost.js +++ b/models/pPost.js @@ -11,7 +11,7 @@ var pPostSchema = new Schema({ for: { type: Schema.ObjectId, ref: 'User' }, project: { type: Schema.ObjectId, ref: 'Project' }, what: { type: String, default: '', trim: true }, - comment: {type: String, default: '', trim: true }, + comment: { type: String, default: '', trim: true }, participants: [], value: { type: Number, defailt: 0 }, file: { type: String, default: '', trim: true }, |