cms/app-client/app/adapters/application.js
author nowmad@nowmads-macbook-pro.local
Tue, 15 Dec 2015 17:22:55 +0100
changeset 56 c4a022ba3fc3
parent 42 7d091abf82fd
child 63 43a8a7893e35
permissions -rw-r--r--
improves fixtures and result list

import DS from 'ember-data';

export default DS.FixtureAdapter.extend({
  host: 'http://127.0.0.1',
  namespace: 'api',
  queryFixtures: function(records, query, type) {
    return records.filter(function(record) {
        for(var key in query) {
            if (!query.hasOwnProperty(key)) { continue; }
            var value = query[key];
            if (record[key] !== value) { return false; }
        }
        return true;
    });
  }
});