_maybeAddAssociationIds(model, attrs) {
    let newHash = Object.assign({}, attrs);

    if (this.serializeIds === "always") {
      [...model.associationKeys]
        .filter((key) => !this._embedFn(key))
        .forEach((key) => {
          let resource = model[key];
          let association = model.associationFor(key);

          if (this.isCollection(resource)) {
            let formattedKey = this.keyForRelationshipIds(key);
            newHash[formattedKey] =
              model[`${this._container.inflector.singularize(key)}Ids`];
          } else if (this.isModel(resource) && association.isPolymorphic) {
            let formattedTypeKey = this.keyForPolymorphicForeignKeyType(key);
            let formattedIdKey = this.keyForPolymorphicForeignKeyId(key);

            newHash[formattedTypeKey] = model[`${key}Id`].type;
            newHash[formattedIdKey] = model[`${key}Id`].id;
          } else if (resource) {
            let formattedKey = this.keyForForeignKey(key);
            newHash[formattedKey] = model[`${key}Id`];
          }
        });
    } else if (this.serializeIds === "included") {
      this.getKeysForIncluded().forEach((key) => {
        let resource = model[key];
        let association = model.associationFor(key);

        if (this.isCollection(resource)) {
          let formattedKey = this.keyForRelationshipIds(key);

          newHash[formattedKey] =
            model[`${this._container.inflector.singularize(key)}Ids`];
        } else if (this.isModel(resource) && association.isPolymorphic) {
          let formattedTypeKey = this.keyForPolymorphicForeignKeyType(key);
          let formattedIdKey = this.keyForPolymorphicForeignKeyId(key);

          newHash[formattedTypeKey] = model[`${key}Id`].type;
          newHash[formattedIdKey] = model[`${key}Id`].id;
        } else if (this.isModel(resource)) {
          let formattedKey = this.keyForForeignKey(key);

          newHash[formattedKey] = model[`${key}Id`];
        }
      });
    }

    return newHash;
  }
@method _maybeAddAssociationIds
    @param model
    @param attrs
    @private
    @hide