From 12037bc566f0b2d5570aaf54503a60f90cc1707e Mon Sep 17 00:00:00 2001 From: John Williams Date: Thu, 5 Dec 2013 15:45:52 -0800 Subject: [PATCH] Don't overwrite statics --- app/models/article.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/models/article.js b/app/models/article.js index ff1e186808..fca75909ec 100644 --- a/app/models/article.js +++ b/app/models/article.js @@ -40,12 +40,10 @@ ArticleSchema.path('title').validate(function(title) { /** * Statics */ -ArticleSchema.statics = { - load: function(id, cb) { - this.findOne({ - _id: id - }).populate('user', 'name username').exec(cb); - } +ArticleSchema.statics.load = function(id, cb) { + this.findOne({ + _id: id + }).populate('user', 'name username').exec(cb); }; -mongoose.model('Article', ArticleSchema); \ No newline at end of file +mongoose.model('Article', ArticleSchema);