Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new record which is marked as invalid can be rollbacked #3083

Merged
merged 1 commit into from
Jun 2, 2015
Merged

A new record which is marked as invalid can be rollbacked #3083

merged 1 commit into from
Jun 2, 2015

Conversation

pangratz
Copy link
Member

Previously rolling back a new record which has been marked as invalid by
the adapter left the record in the loaded.created.uncommitted state.


This addresses the issues raised in #2943 (comment):

rolling back a new record which is marked as invalid puts the record in the loaded.created.uncommitted state. Is this the intended behavior? There are currently no tests for this case in rollback-test.js so it needs to be discussed what should be the intended behavior here.

Previously rolling back a new record which has been marked as invalid by
the adapter left the record in the `loaded.created.uncommitted` state.
@@ -399,6 +399,9 @@ var createdState = dirtyState({
isNew: true
});

createdState.invalid.rolledBack = function(record) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is much better solution then my last commit. I was trying to handle it same way but within createdState.invalid.rolleback which is of course wrong. +1

@turboMaCk
Copy link
Contributor

+1

@tchak
Copy link
Member

tchak commented Jun 2, 2015

+1 I think it is good to merge @igorT

igorT added a commit that referenced this pull request Jun 2, 2015
…backed

A new record which is marked as invalid can be rollbacked
@igorT igorT merged commit 34efef0 into emberjs:master Jun 2, 2015
@igorT
Copy link
Member

igorT commented Jun 2, 2015

Thanks!

@pangratz pangratz deleted the invalid_new_record_can_be_rollbacked branch June 2, 2015 13:26
@tananrules
Copy link

+1

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

Successfully merging this pull request may close these issues.

5 participants