MCPcopy Index your code
hub / github.com/sequelize/sequelize / model

Method model

src/sequelize.js:481–487  ·  view source on GitHub ↗

* Fetch a Model which is already defined * * @param {string} modelName The name of a model defined with Sequelize.define * * @throws Will throw an error if the model is not defined (that is, if sequelize#isDefined returns false) * @returns {Model} Specified model

(modelName)

Source from the content-addressed store, hash-verified

479 * @returns {Model} Specified model
480 */
481 model(modelName) {
482 if (!this.isDefined(modelName)) {
483 throw new Error(`${modelName} has not been defined`);
484 }
485
486 return this.modelManager.getModel(modelName);
487 }
488
489 /**
490 * Checks whether a model with the given name is defined

Callers 4

sequelize.test.jsFile · 0.80
constructorMethod · 0.80

Calls 2

isDefinedMethod · 0.95
getModelMethod · 0.80

Tested by

no test coverage detected