update(key, val) {
    let attrs;
    if (key == null) {
      return this;
    }

    if (typeof key === "object") {
      attrs = key;
    } else {
      (attrs = {})[key] = val;
    }

    Object.keys(attrs).forEach(function (attr) {
      if (
        !this.associationKeys.has(attr) &&
        !this.associationIdKeys.has(attr)
      ) {
        this._definePlainAttribute(attr);
      }
      this[attr] = attrs[attr];
    }, this);

    this.save();

    return this;
  }
Updates the record in the db.

    ```js
    let author = authors.find(1);
    let followers = users.find([1, 2]);
    let post = blogPosts.find(1);
    post.update('title', 'Hipster ipsum'); // the db was updated
    post.update({
      title: 'Lorem ipsum',
      created_at: 'before it was cool'
    });
    post.update({ author });
    post.update({ followers });
    ```

    @method update
    @param {String} key
    @param {any} val
    @return this
    @public