MCPcopy
hub / github.com/sequelize/sequelize / model

Method model

lib/sequelize.js:470–476  ·  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

468 * @returns {Model} Specified model
469 */
470 model(modelName) {
471 if (!this.isDefined(modelName)) {
472 throw new Error(`${modelName} has not been defined`);
473 }
474
475 return this.modelManager.getModel(modelName);
476 }
477
478 /**
479 * Checks whether a model with the given name is defined

Callers 4

constructorMethod · 0.80
sequelize.test.jsFile · 0.80

Calls 2

isDefinedMethod · 0.95
getModelMethod · 0.80

Tested by

no test coverage detected