firstOrCreate(query, attributesForCreate = {}) {
    let queryResult = this.where(query);
    let [record] = queryResult;

    if (record) {
      return record;
    } else {
      let mergedAttributes = Object.assign(attributesForCreate, query);
      let createdRecord = this.insert(mergedAttributes);

      return createdRecord;
    }
  }
Finds the first record matching the provided _query_ in
    `collection`, or creates a new record using a merge of the
    `query` and optional `attributesForCreate`.

    Often times you may have a pattern like the following in your API stub:

    ```js
    // Given users = [
    //   { id: 1, name: 'Link' },
    //   { id: 2, name: 'Zelda' }
    // ]

    // Create Link if he doesn't yet exist
    let records = db.users.where({ name: 'Link' });
    let record;

    if (records.length > 0) {
      record = records[0];
    } else {
      record = db.users.insert({ name: 'Link' });
    }
    ```

    You can now replace this with the following:

    ```js
    let record = db.users.firstOrCreate({ name: 'Link' });
    ```

    An extended example using *attributesForCreate*:

    ```js
    let record = db.users.firstOrCreate({ name: 'Link' }, { evil: false });
    ```

    @method firstOrCreate
    @param query
    @param attributesForCreate
    @public