More verbose newRecord check #21

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

cozmo commented Jan 24, 2012

the current method checks if the instance has an id, and if not, then it is new. This is fine if the id is created by the server, but if we use the client to create the id, it will never be considered "new" even on the first save. Instead it should use the same method used in the add function.

Ubuntu Use a more verbose check with newRecord (the current checks if the re…
…cord has an id, and if not, it is new. This is fine if the id is created by the server, but if we use the client to create the id, it will never be considered "new" even on the first save. Instead use the same method used in the add function.
304ebf2
Owner

benpickles commented Jan 27, 2012

You say you are using the client to generate an id attribute, I assume doing model.id() returns undefined? I'm reading between the lines here but I think your problem might be that the id attribute is being stored in the changes object until you call save() on the model. What's returned for model.attr("id")?

cozmo commented Apr 15, 2015

This PR is old enough I don't recall any of the context. Sorry for letting this sit. Closing.

cozmo closed this Apr 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment