Sequelize TypeError Associate is not a Function
<p>I am creating a one-to-many relationship and ran into a strange error when I pass the associated model to my db object. I don't understand where the error will come from as the method follows the documentation. Do I need to write a reference within my targeted model?</p>

<p><strong>Error:</strong></p>

<pre><code>db.DiscoverySource.associate(db);
                   ^

TypeError: db.DiscoverySource.associate is not a function
    at Object.&lt;anonymous&gt; (/Users/user/Desktop/Projects/node/app/app/models/db-index.js:33:20)
</code></pre>

<p><strong>Source Model (One) organization.js:</strong></p>

<pre><code>module.exports = function(sequelize, DataTypes) {

var Organization = sequelize.define('organization', {
    organizationId: {
        type: DataTypes.INTEGER,
        field: 'organization_id',
        autoIncrement: true,
        primaryKey: true
    },
    organizationName: {
        type: DataTypes.STRING,
        field: 'organization_name'
    },
    admin: DataTypes.STRING
},{
    freezeTableName: true,
    classMethods: {
        associate: function(db) {
            Organization.belongsToMany(db.User, { through: 'member', foreignKey: 'user_id' }),
            Organization.hasMany(db.DiscoverySource, { foreignKey: 'organization_id' });
        },
    }
});
    return Organization;
}
</code></pre>

<p><strong>Target (Many) discovery-source.js:</strong></p>

<pre><code>module.exports = function(sequelize, DataTypes) {

var DiscoverySource = sequelize.define('discovery_source', {
    discoverySourceId: {
        type: DataTypes.INTEGER,
        field: 'discovery_source_id',
        autoIncrement: true,
        primaryKey: true
    },
    discoverySource: {
        type: DataTypes.STRING,
        field: 'discovery_source_name'
    },
    organizationId: {
        type: DataTypes.TEXT,
        field: 'organization_id'
    },
},{
    freezeTableName: true,
});
    return DiscoverySource;
}
</code></pre>

<p><strong>db-index.js joining the models:</strong></p>

<pre><code>var Sequelize = require('sequelize');
var path = require('path');
var config = require(path.resolve(__dirname, '..', '..','./config/config.js'));
var sequelize = new Sequelize(config.database, config.username, config.password, {
    host:'localhost',
    port:'3306',
    dialect: 'mysql'
});

sequelize.authenticate().then(function(err) {
    if (!!err) {
        console.log('Unable to connect to the database:', err)
    } else {
        console.log('Connection has been established successfully.')
    }
});

var db = {}

db.Member = sequelize.import(__dirname + "/member");

db.Organization = sequelize.import(__dirname + "/organization");

db.User = sequelize.import(__dirname + "/user");

db.DiscoverySource = sequelize.import(__dirname + "/discovery-source");

db.User.associate(db);
db.Organization.associate(db);
db.DiscoverySource.associate(db);

db.sequelize = sequelize;
db.Sequelize = Sequelize;

sequelize.sync();

module.exports = db;
</code></pre>