briankircho/mongoose-schema-extend — pull request #27 by B3rn475 (2014-11-16 15:38:46+00:00)
Title: Fixed problem with regexps

I've fixed a problem with RegExp in validation.
If you do this.
```js
var mongoose = require('mongoose'),
extend = require('mongoose-schema-extend');
var Schema = mongoose.Schema;

var PersonSchema = new Schema({
name : {type: String, validate: /^[a-zA-z ]+$/}
}, { collection : 'users' });

var EmployeeSchema = PersonSchema.extend({
department : String
});

var Person = mongoose.model('Person', PersonSchema),
Employee = mongoose.model('Employee', EmployeeSchema);

// Error during validation
var Brian = new Employee({
name : 'Brian Kirchoff',
department : 'Engineering'
});
```
It will crash during validation.

I've fixed it.