template/sequelize4/index.js
function defineModel(file) {
    var object      = require(file),
        options     = object.options || {},
        modelName   = object.modelName;

    if (debug) {
        fs.writeSync(debugFD, 'var ' + modelName + ' = Sequelize.define("' + modelName + '",\n' + util.inspect(object.attributes) + ',\n' + util.inspect(options, {depth: null}) + ');\n\n\n');
    }

    models[modelName] = sequelize.define(modelName, object.attributes, options);
    if (object.relations !== undefined) {
        relationships[modelName] = object.relations;
    }
}
function defineModel(file) {
    var object      = require(file),
        options     = object.options || {},
        modelName   = object.modelName;

    if (debug) {
        fs.writeSync(debugFD, 'var ' + modelName + ' = Sequelize.define("' + modelName + '",\n' + util.inspect(object.attributes) + ',\n' + util.inspect(options, {depth: null}) + ');\n\n\n');
    }

    models[modelName] = sequelize.define(modelName, object.attributes, options);
    if (object.relations !== undefined) {
        relationships[modelName] = object.relations;
    }
}
function defineModel ( file ) { var object = require ( file ) , options = object . options || { } , modelName = object . modelName ; if ( debug ) { fs . writeSync ( debugFD , 'var ' + modelName + ' = Sequelize.define("' + modelName + '",\n' + util . inspect ( object . attributes ) + ',\n' + util . inspect ( options , { depth : null } ) + ');\n\n\n' ) ; } models [ modelName ] = sequelize . define ( modelName , object . attributes , options ) ; if ( object . relations !== undefined ) { relationships [ modelName ] = object . relations ; } }
Requires given npm module file and defines sequelize module according to exported object from that module.
@private
@param {string} file - Location of the npm module file which contains model definition.
Requires given npm module file and defines sequelize module according to exported object from that module .