cms/app-client/app/adapters/application.js
author nowmad@nowmads-macbook-pro.local
Thu, 10 Dec 2015 16:50:53 +0100
changeset 42 7d091abf82fd
child 63 43a8a7893e35
permissions -rw-r--r--
add application adapter to simulate REST, using fixtures

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;
    });
  }
});