Quantcast
Viewing all articles
Browse latest Browse all 4826

I can see record twice after createRecord() and save()

@marxsk wrote:

I have an Ember app that works mostly as expected. But I’m not sure about how to understand following situation (= it is a bug or a feature) ?

Let’s have a simple model with (DS.attr(‘string’)) when I do .createRecord() and .save() I can see record immediately on the page (with expected flags). When the record is really saved there is still just one shown record. I thought that this will work every time but it is not true.

With a model which does not have any attribute only relationships:

 DS.Model.extend({
  constraintSet: DS.belongsTo('constraint-set'),
  resources: DS.hasMany('resource'),
 })

I can see it immediately after createRecord() [with hasDirtyAttributes as expected] but after save() is finished. I can see it on the page two times.

Can anyone help me to understand it? Or is it a bug?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles