Permalink
Browse files

fix hanging validation on query results

  • Loading branch information...
aheckmann committed Mar 19, 2011
1 parent 254afd2 commit 29dc880072f11d522b195b0e0ec5f9e910e170d0
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/mongoose/schematype.js
@@ -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){

0 comments on commit 29dc880

Please sign in to comment.