title: Cannot access Sequelize instance methods
body: <p>I get the following error when I attempt to call the <code>generateHash</code> instance method I've defined on my User model:</p>
  
  <p><code>User.generateHash(...).then is not a function</code></p>
  
  <p>Here's the model definition itself:</p>
  
  <pre><code>const User = sequelize.define('User', 
  {
      firstName: {
          type: Sequelize.TEXT,
          field: 'first_name'
      },
      lastName: {
          type: Sequelize.TEXT,
          allowNull: false,
          field: 'last_name'
      },
      userName: {
          type: Sequelize.TEXT,
          field: 'user_name',
          allowNull: false
      },
      password: {
          type: Sequelize.TEXT,
          allowNull: false
      }
  }, {
      tableName: 'users',
      underscored: true,
      classMethods: {
          associate: function(models) {
              User.hasMany(
        models.Trip,
                  {
                      as: 'trips',
                      foreignKey: {
                          name: 'userId',
                          field: 'user_id',
                          allowNull: false
                      },
                      onDelete: 'CASCADE'
                  });
          },
      },
      instanceMethods: {
          generateHash: function(password) {
              return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
          },
          validatePassword: function(password) {
              return bcrypt.compareSync(password, this.password);
          },
          apiRepr: function() {
              return {
                  id: this.id,
                  firstName: this.firstName,
                  lastName: this.lastName,
                  userName: this.userName
              };
          }
      }
  });
  </code></pre>
  
  <p>Here's the endpoint where I attempt to call the method:</p>
  
  <pre><code>router.post('/', (req, res) =&gt; {
  let {userName, password, firstName, lastName} = req.body;
  
  // if no existing user, hash password
  return User.generateHash(password)
      .then(hash =&gt; {
          // create new user
          return User.create({
              firstName: firstName,
              lastName: lastName,
              userName: userName,
              password: hash
          });
      })
      .then(user =&gt; {
          // send back apirRepr data
          return res.status(201).json(user.apiRepr());
      })
      // error handling
      .catch(err =&gt; {
          if (err.name === 'AuthenticationError') {
              return res.status(422).json({message: err.message});
          }
          res.status(500).json({message: 'Internal server error'});
      });});
  </code></pre>
  
  <p>I'm totally stuck. Any ideas?</p>