1

I'm trying to search for all employees that have a title of developer

As per the documentation (http://guides.emberjs.com/v1.10.0/models/finding-records/) It seems the correct way to do this is:

return this.store.find('employee', { title: "developer" });

But this is not working in Ember CLI 0.2.2, and I can't even see my template when I try this, even though when I do

return this.store.find('employee')

I can see a list of all employees and there are multiple employees with that title

TheCompiler
  • 310
  • 2
  • 11

1 Answers1

0

Turns out I needed to override the DS.FixtureAdapter::queryFixtures method. I went into my adapters/application.js file and added

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;
  });
}
TheCompiler
  • 310
  • 2
  • 11