async saveRelationships () {
    const calls = collect(this.relationships)
      .filter(rel => !rel.readonly)
      .reduce(this._flattenRelationships, [])
      .filter(model => model.isDirty() || model.isNew)
      .map(model => model.createOrUpdate().catch(err => err))

    const responses = await Promise.all(calls)

    this._emit(Model.RELATIONS_SAVED, { responses, model: this })

    return responses
  }
/**
   * Detect any changes to the relationship models and save them
   *
   * @returns {Promise<array>}
   */
Detect any changes to the relationship models and save them
@returns {Promise}
Detect any changes to the relationship models and save them @returns { Promise }
async saveRelationships () {
    const calls = collect(this.relationships)
      .filter(rel => !rel.readonly)
      .reduce(this._flattenRelationships, [])
      .filter(model => model.isDirty() || model.isNew)
      .map(model => model.createOrUpdate().catch(err => err))
    const responses = await Promise.all(calls)
    this._emit(Model.RELATIONS_SAVED, { responses, model: this })
    return responses
  }
async saveRelationships ( ) { const calls = collect ( this . relationships ) . filter ( rel => ! rel . readonly ) . reduce ( this . _flattenRelationships , [ ] ) . filter ( model => model . isDirty ( ) || model . isNew ) . map ( model => model . createOrUpdate ( ) . catch ( err => err ) ) const responses = await Promise . all ( calls ) this . _emit ( Model . RELATIONS_SAVED , { responses , model : this } ) return responses }
Detect any changes to the relationship models and save them
 @returns {Promise<array>}
Detect any changes to the relationship models and save them @returns { Promise<array > }