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

Commit

Permalink
Merge pull request #160 from CREO-Agency/statics_overwrite
Browse files Browse the repository at this point in the history
Don't overwrite statics
  • Loading branch information
amoshaviv committed Dec 10, 2013
2 parents 209b702 + 12037bc commit 0697df0
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 0697df0

Please sign in to comment.