-
Notifications
You must be signed in to change notification settings - Fork 10
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
confirmation validations in component #29
Comments
I just realized, that if I change in my validations to |
This is problematic using and I have the error: |
I tried too create model from EmberObject, but it's also impossible because of
|
Sorry for spam, but still trying to do something. I created
on my confirm validation:
it's impossible to match password from changeset I have value and here: I have current value from If I change in template it for example to |
Just discovered this myself. The real problem is that the object that is passed into the validation is the actual model, not the changeset model (Meaning 'changeset.password' should NOT have worked for you). I am guessing that the only validator that actually uses the model is confirmation and possibly custom. I would think that changing the code to ensure that the changeset model is whats passed would solve the problem. Looking into it. Although I can only do a pull request, Since no one answered your question yet, not sure if there is someone that would execute the pull request. |
After spending time looking at this issue, I do not see any way this could work without completely rewriting the cp validations addon. A reference to the model to be validated seems to be stored on every sub class. Many of the classes are not exposed to extend or reopen. When I tried to override some of the functionality supporting functions needed were not exported (they were private and I understand why, but....) I was able to change the model by some clever use of bind, but in cp-validations when it tried to perform from methods, it expected those methods to be on the object, and since changeset is a proxy, they were not found. I tried to go the route of exposing proxy methods on changeset, which also led to a lot of code that needed changed. Im at a loss and just dont see this happening sadly. |
Ok, so here is the solution I came up with
Yes you have to check isValid on both objects (a simple computed.and will abstract that) and hey, you really didnt need the property confirm password on the user object anyway did you. Hope this helps |
Hello, I have an issue related to validate confirmation of real-time update (skip validate option).
I created a special repository to show what is happening with instructions how to reproduce it.
https://github.com/olenderhub/changeset-with-cp-validations
Should I use these addons in a different way or it's bug that needs to be fixed?
The text was updated successfully, but these errors were encountered: