Ember Data: CreateRecord does not update the model when using store.find with query parameters

When my route model uses this.store.find('user'), it is automatically updated, and the new entries created with are displayed in the template 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 the route model to use the request parameter version find, the template is no longer updated when I docreateRecord

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 that this may be a mistake, since the only change in the code is the transition from the base find('user')to the version with query parameters. Is this the expected behavior for ember data? Why the model does not update the template after the call createRecordwhen the search version of the param request is used (i.e. find('user', {}))

jsbin, .

http://jsbin.com/kilaridoso/2/edit?html,js,output

!

:

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: -------------------------------
+4
1

, , Ember-Data GitHUB. , . wecc (!)

store.find(type, query) RecordArray, , , .

store.filter(, , ) (docs) .

store.find(, ), , , ED , . , {isUnread: true}, - {: '2015-05-10 10:51'}. store.filter(, , ), , , ED , , RecordArray .

:

https://github.com/emberjs/data/issues/3057

+5

All Articles