Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addModel(modelClass) {
if (Model.isPrototypeOf(modelClass)) {
modelClass.app = this
this.models[modelClass.name] = modelClass
} else {
throw new Error(`Invalid model class: ${modelClass}`)
}
}
data.relationMappings = clone(modelClass.relationMappings, value =>
Model.isPrototypeOf(value) ? `[Model: ${value.name}]` : value
)