# HG changeset patch # User nowmad@23.1.168.192.in-addr.arpa # Date 1450351310 -3600 # Node ID 87946963c3bb53119ff0dad6372a7dc28de2e400 # Parent 69977e2aa39eb88abf30b33c23ba30c266ccc5cc add queryFixture to be able to simulate query on the fixtures data diff -r 69977e2aa39e -r 87946963c3bb cms/app-client/app/adapters/application.js --- a/cms/app-client/app/adapters/application.js Thu Dec 17 12:15:57 2015 +0100 +++ b/cms/app-client/app/adapters/application.js Thu Dec 17 12:21:50 2015 +0100 @@ -3,4 +3,14 @@ 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; + }); + } });