Skip to content

Commit

Permalink
fix hanging validation on query results
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Mar 19, 2011
1 parent 254afd2 commit 29dc880
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/mongoose/schematype.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ SchemaType.prototype.validate = function(obj, error){
*/

SchemaType.prototype.required = function(required){
var checkRequired = this.checkRequired.bind(this);
var self = this;

function checkRequired (v) {
return self.checkRequired(v);
}

this.isRequired = true;

if (false === required){
Expand Down

0 comments on commit 29dc880

Please sign in to comment.