Ember Data now uses a snapshot of the model when serializing a record. From what I’ve read, I think this change should be invisible to developers. However, using the RESTSerializer, when I request a model, make a change to an attribute and then call model.save(), I’m getting an error on the following line of the serializeAttribute function
var value = snapshot.attr(key);
that undefined is not a function.
The actual snapshot object looks like a record instead of a snapshot (there is no attr function associated with it). Is there a step where I actually create the snapshot? Am I missing something?
I’m having this same issue in 1.0.0-beta.14 too, within the serializeBelongsTo method.
Just double-checked the changelog and subsequently updated to beta.15 and it appears to be working for me now.
This is happening to me on ED 1.0.0-beta.15 when doing:
Specifically on serializeAttribute’s
var value = snapshot.attr(key); claiming that
.attr() is not a function.
Any information on this?
Answered my own question. It’s in relation to Snapshot not being injected on beta.15 #2801. It seems to be an adapter problem. Time to dig in!
Turned out to be a simple custom adapter issue for us. We were overriding the snapshot with the object.