Details: ember-data-1.0.0.beta.3 and the default RESTAdapter
I might have misunderstood how the store.find()
method works, but, from my understanding, the following code should not query the server if the records I'm asking for are already present in the store:
var IndexRoute = Em.Route.extend({
model: function() {
return this.store.find('link');
},
});
From the emberjs.com documentation for DS.Store.find()
:
The find method will always return a promise that will be resolved with the record. If the record was already in the store, the promise will be resolved immediately. Otherwise, the store will ask the adapter's find method to find the necessary data.
I have another route with the exact same model hook, but when I visit that route, and even though the data is already in the store, the server gets queried. And if I go back to the Index route, it gets queried again. Shouldn't .find()
handle this?