Skip to content

Commit

Permalink
Changes express middleware returned function to avoid assigned req.db…
Browse files Browse the repository at this point in the history
… and req.models more than once (#76)
  • Loading branch information
dresende committed Mar 14, 2013
1 parent ff2cda6 commit f29ed73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Express.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module.exports = function (uri, opts) {
});

return function ORM(req, res, next) {
if (req.hasOwnProperty("models")) {
return next();
}

req.models = _models;
req.db = _db;

Expand Down

0 comments on commit f29ed73

Please sign in to comment.