Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Don't overwrite statics
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaidan committed Dec 5, 2013
1 parent dbe7213 commit 12037bc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/models/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
mongoose.model('Article', ArticleSchema);

0 comments on commit 12037bc

Please sign in to comment.