title: Sequelize belongsToMany relationship not working
body: <p>First, I am loading my models with a function:</p>
  
  <pre><code>module.exports = function(config) {
    var db, files, modelPath, myDb, sequelize;
    sequelize = new Sequelize(config.database, config.username, config.password, {
      dialect: 'postgres',
      host: config.host,
      port: config.port,
      logging: false,
      define: {
        charset: 'utf8',
        collate: 'utf8_general_ci'
      }
    });
    db = {};
    modelPath = __dirname + "/models";
    files = fs.readdirSync(modelPath);
    _.each(files, function(file) {
      var model;
      if ('.coffee' === path.extname(file)) {
        model = sequelize["import"](path.join(modelPath, file));
        return db[model.name] = model;
      }
    });
    Object.keys(db).forEach(function(modelName) {
      if ('associate' in db[modelName]) {
        return db[modelName].associate(db);
      }
    });
    myDb = _.assign(db, {
      sequelize: sequelize,
      Sequelize: Sequelize
    });
    return myDb;
  };
  </code></pre>
  
  <p>I have 2 models that are associated:</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes) {
    var User;
    User = sequelize.define('User', {
      name: {
        type: DataTypes.STRING,
        allowNull: false
      },
      username: {
        type: DataTypes.STRING,
        allowNull: false,
        unique: true
      },
      email: {
        type: DataTypes.STRING,
        allowNull: false,
        unique: true,
        validate: {
          isEmail: true
        }
      },
      password: {
        type: DataTypes.STRING,
        allowNull: false
      },
      status: {
        type: DataTypes.ENUM('active', 'inactive'),
        defaultValue: 'active'
      },
      api_key: {
        type: DataTypes.STRING,
        allowNull: true
      }
    }, {
      instanceMethods: {
        display: function() {
          var user;
          user = {
            name: this.name,
            email: this.email,
            username: this.username,
            active: this.active
          };
          return user;
        }
      }
    }, {
      classMethods: {
        associate: function(models) {
          return User.belongsToMany(models.Entity, {
            through: 'UserEntity'
          });
        }
      }
    });
    User.hook('beforeCreate', function(user, options, beforeCreateCb) {
      var uniqueKey;
      uniqueKey = (JSON.stringify(user)) + " " + (new Date()) + " " + (Math.random());
      user.api_key = crypto.createHash('md5').update(uniqueKey).digest('hex');
      return beforeCreateCb(null, user);
    });
    return User;
  };
  </code></pre>
  
  <p>and</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes) {
    var Entity;
    return Entity = sequelize.define('Entity', {
      name: {
        type: DataTypes.STRING,
        allowNull: false
      }
    }, {
      classMethods: {
        associate: function(models) {
          return Entity.belongsToMany(models.User, {
            through: 'UserEntity'
          });
        }
      }
    });
  };
  </code></pre>
  
  <p>I found a user via: </p>
  
  <pre><code>myDb.User.find({
    where: {
      username: 'snakamoto'
    }
  }).then(function(dbUser) {
    var entities;
    should.exist(dbUser.id);
    entities = dbUser.getEntities();
    return done();
  });
  </code></pre>
  
  <p>However, I get an error: <code>TypeError: Object [object SequelizeInstance] has no method 'getEntities'</code></p>
  
  <p>Not sure what I'm doing wrong. I am using <code>2.0.1</code> if that matters.</p>