When my route model uses this.store.find('user') it updates automatically and the template shows new records created using createRecord. So the following works as expected:
Route:
model: function(){
return this.store.find('user');
}
Template:
{{#each user in model}}
{{user.username}}<br>
{{/each}}
Controller Code:
// Triggered when form submitted to create a new user
var newUser = this.store.createRecord('user', {
username: this.get('username').trim()
});
// new user shows up in template immediately after createRecord
If I change my route model to use the query params version of find the template no longer updates when I do a createRecord
Route:
model: function(){
// query params version of store.find
return this.store.find('user', {enabledOnly: false, limit: 100});
}
Controller Code:
// Triggered when form submitted to create a new user
var newUser = this.store.createRecord('user', {
username: this.get('username').trim()
});
// new user does not show up in template at all
It seems like this might be a bug as the only change in the code is switching from the basic find('user') to the version that has query params. Is this expected behavior for ember data? Why would the model not update the template after createRecord is called when the query param version of find is used (i.e., find('user', {}))
I was able to create a jsbin that demonstrates the issue.
Thank you!
I am using the following version:
DEBUG: -------------------------------
ember.debug.js:5197DEBUG: Ember : 1.11.1
ember.debug.js:5197DEBUG: Ember Data : 1.0.0-beta.16.1
ember.debug.js:5197DEBUG: jQuery : 1.11.3
ember.debug.js:5197DEBUG: Ember Simple Auth : 0.8.0-beta.2
ember.debug.js:5197DEBUG: -------------------------------