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

Already on GitHub? Sign in to your account

Fix for Issue #852: Have errors be an Ember.Object #565

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
2 participants

Addresses Issue #852

Contributor

bcardarella commented Apr 20, 2013

#852 actually calls for there to be a permanent errors object hanging off of any DS.Model instance. The Error object itself needs to have the ability to clear itself and to add new errors. This add function is not the same as setProperties on a regular Ember.Object instance As @hjdivad and I discussed the other day on this we both agreed something similar to the Error class I implemented in ember-validations is a good first step: https://github.com/dockyard/ember-validations/blob/master/packages/ember-validations/lib/errors.js

The existence of this Error object in ember-data would allow ember-validations to work with server side errors. Beyond that there are still a lot to tackle to get this fine tuned.

That makes sense, I'll take another whack at this more along the lines of what you're suggested. Seems like if we add an errors object, have it clear errors when it becomes inflight and add errors in becameInvalid this would be a good start. Seem right?

herp derp. That's exactly what you said at the beginning of the issue, sorry

Contributor

bcardarella commented Apr 21, 2013

@superchris I would just take the Errors object I wrote in ember-validations

@bcardarella Yes, that would be my plan. Use your errors object and add code to ember-data to use it correctly.

Contributor

bcardarella commented Apr 21, 2013

@superchris you should also reference this issue: dockyard/ember-validations#15 as there is more than one place where the errors object is being cleared out in ember-data

starting over with a new PR

@superchris superchris closed this Apr 22, 2013

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