Skip to content

v2.7.6

Compare
Choose a tag to compare
@danielspaniel danielspaniel released this 06 Sep 22:45
· 592 commits to master since this release
  • mockUpdate and mockDelete now match even if there are params in url #240
  • Using urlForFindRecord method if available on the your model's adapter #241

Usage:

// app/adapters/employee.js
import DS from 'ember-data';

export default DS.JSONAPIAdapter.extend({
    urlForFindRecord(id, modelName, snapshot) {
      if (id === 'self') {
        return '/user';
      } else {
        return this._super(id, modelName, snapshot);
      }
    }
});
// if you don't care that the id returned is 'self' then simply do:
let mock = mockFindRecord('employee', {id: 'self'});

// if you want to return an employee with normal id
let employee = build('employee');
let mock = mockFindRecord('employee', {id: 'self'}).returns({json:employee});
  • Deprecated mockFind in favor of mockFindRecord