1 |
|
2 | var fs = require('fs'),
|
3 | path = require('path');
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | module.exports = function loadModels(compound, root) {
|
11 | if (!compound.structure.models) {
|
12 | return;
|
13 | }
|
14 |
|
15 | Object.keys(compound.structure.models).forEach(function(model) {
|
16 | var md = compound.structure.models[model];
|
17 | var foundModel = compound.model(model);
|
18 | if (foundModel && foundModel._validations) {
|
19 | delete foundModel._validations;
|
20 | }
|
21 | if (typeof md === 'function') {
|
22 | md(compound, foundModel);
|
23 | } else {
|
24 |
|
25 | }
|
26 | });
|
27 |
|
28 | };
|
29 |
|