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);