不要怂,就是干,撸起袖子干!

Commit 71ae1cde by Trey Thomas

Use findOne instead of findAll in findById

1 parent c4ee8dd5
Showing with 2 additions and 4 deletions
...@@ -1466,10 +1466,8 @@ Model.prototype.findById = function(param, options) { ...@@ -1466,10 +1466,8 @@ Model.prototype.findById = function(param, options) {
throw new Error('Argument passed to findById is invalid: '+param); throw new Error('Argument passed to findById is invalid: '+param);
} }
// Bypass a possible overloaded findAll. // Bypass a possible overloaded findOne
return Model.prototype.findAll.call(this, _.defaults(options, { return Model.prototype.findOne.call(this, options);
plain: true
}));
}; };
Model.prototype.findByPrimary = Model.prototype.findById; Model.prototype.findByPrimary = Model.prototype.findById;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!