peerigon/alamid-schema — pull request #3 by jhnns (2014-02-19 01:59:54+00:00)
Title: Feature extend

With this feature it's possible to create a new schema that inherits from the current schema. Field definitions are merged where appropriate. If a definition conflicts with the parent definition, the child's definition supersedes.

```javascript
var schema = new Schema({
age: {
required: true,
max: 99,
validate: oldEnough
}
}),
extended = schema.extend({
age: {
required: false,
validate: notTooOld
}
}),
ageValidators = extended.validators.age.toString();

expect(ageValidators).to.contain(validators.max(), oldEnough, notTooOld);
expect(ageValidators).to.not.contain(validators.required());
```