Skip to content

Commit

Permalink
#32 Requesting scope for a collection read
Browse files Browse the repository at this point in the history
  • Loading branch information
tracend committed Nov 22, 2012
1 parent 451bf74 commit c5e7f82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion helpers/mongooseStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ module.exports = function(Model) {
Model.findOne({ _id: req.model._id }, callback);
} else {
// collection
Model.find(req.model, callback);
// - use a scope if available
if(req.scope){
Model.find(req.model, req.scope, callback);
} else {
Model.find(req.model, callback);
}
}
},

Expand Down

0 comments on commit c5e7f82

Please sign in to comment.