This repository was archived by the owner on Jan 31, 2019. It is now read-only.
A model that is not "dirty" can't transition to "uncommitted".#14
Merged
bcardarella merged 2 commits intoDavyJonesLocker:masterfrom Apr 21, 2013
Merged
A model that is not "dirty" can't transition to "uncommitted".#14bcardarella merged 2 commits intoDavyJonesLocker:masterfrom
bcardarella merged 2 commits intoDavyJonesLocker:masterfrom
Conversation
Contributor
|
Could we get a test case for this? How the validations are being handled will probably be refactored eventually to match whatever happens in |
Contributor
Author
|
OK, I will create a test case! |
Contributor
|
@diogomafra any updates on this? |
Contributor
Author
|
I was busy this week and could not create the test. I will try to finish it today. |
Contributor
Author
|
I added a test, it's similar to a test that already exists, checking the behavior using the stateManager. This test is very 'artificial', because we're just simulating the When |
Contributor
|
Yes I agree |
bcardarella
added a commit
that referenced
this pull request
Apr 21, 2013
A model that is not "dirty" can't transition to "uncommitted".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a ember-data model is validated, the validator changes its state to 'uncommitted', but it fails silently when the model is not dirty. It does not show any error because the deferred is not catching the errors.
You can see the problem adding this code on line 83 of
mixin.js:.then(null, function(err){alert(err);});. The could should look like this:And then, just try to validate a model that is not dirty:
App.MyModel.find(1).validate().It throws this error:
Error: assertion failed: Could not find state for path: "uncommitted".