Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Destroy model with temp id #115

Closed
wants to merge 3 commits into from

Conversation

MichaReiser
Copy link
Contributor

If a model with a temp id is destroyed, then the callbacks should be invoked too.

Micha Reiser added 3 commits June 22, 2014 12:17
When a model with a temp id is destroyed, then the success and error
callbacks should be invoked too.
If a model with a temp id is destroyed, it should not be marked as
destroyed. Because it has never been synced with the server.
@@ -205,7 +205,7 @@ localsync = (method, model, options) ->
store.clean(model, 'dirty')
when 'delete'
store.destroy(model)
if options.dirty
if options.dirty && !model.hasTempId()
store.destroyed(model)
else
if model.id.toString().length == 36
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. While looking at this, I noticed also that line 211 should use hasTempId().

@nilbus nilbus closed this in c2edeee Jun 23, 2014
@nilbus
Copy link
Owner

nilbus commented Jun 23, 2014

Thanks @DatenMetzgerX ! Good find and fix.

I rewrote each commit to include an amd build (ran make) since make watch doesn't do that one. Your commits are merged into master.

@nilbus
Copy link
Owner

nilbus commented Feb 16, 2015

Released in v1.4.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants