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

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) {
throw new Error('Argument passed to findById is invalid: '+param);
}
// Bypass a possible overloaded findAll.
return Model.prototype.findAll.call(this, _.defaults(options, {
plain: true
}));
// Bypass a possible overloaded findOne
return Model.prototype.findOne.call(this, options);
};
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!