Skip to content

Commit b3472ac

Browse files
committedNov 4, 2015
fix; apply methods to single embedded schemas (Fix #3534)
1 parent 63ed80b commit b3472ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎lib/schema/embedded.js

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ function Embedded(schema, path, options) {
2323
_embedded.$isSingleNested = true;
2424
_embedded.prototype.$basePath = path;
2525

26+
// apply methods
27+
for (var i in schema.methods) {
28+
_embedded.prototype[i] = schema.methods[i];
29+
}
30+
31+
// apply statics
32+
for (i in schema.statics) {
33+
_embedded[i] = schema.statics[i];
34+
}
35+
2636
this.caster = _embedded;
2737
this.schema = schema;
2838
this.$isSingleNested = true;

0 commit comments

Comments
 (0)
Please sign in to comment.