Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Model caching issue

$
0
0
So after some looking into the code it seems like the problem is with this chunk of code, lines 239-247 of can/model/model.js:

  1. var id = attributes[this.id],
  2. // 0 is a valid ID.
  3. model = (id || id === 0) && this.store[id] ?
  4. // If this model is in the store already, just update it.
  5. this.store[id].attr(attributes, this.removeAttr || false) :
  6. // Otherwise, we need a new model.
  7. new this(attributes);

  8. return model;

The problem is that because the attendees attribute has been shortened by one, line 5 will not change this attribute, it only gets updated when its increased in length, this is confirmed by adding attendees directly into the databse then making the findone call, the atendees is then correct. This seems like a bug

Viewing all articles
Browse latest Browse all 3491

Trending Articles