-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Validate a computed property or native getter? #474
Comments
@andreyfel Interesting! I'm trying to understand how we could accommodate such as use case. I would have thought extending the changeset would have worked (and perhaps the only viable solution). Happen to have a small reproduction? |
@snewcomer I've added a failing test here: #482. |
@snewcomer here is an attempt to fix this scenario adopted-ember-addons/validated-changeset#54 |
@snewcomer I updated the test case and bumped the validated changeset version. I think this PR #482 can be merged to verify the behavior on the level of ember-changeset? |
3.5.0! Thanks for all your work!!! |
Let's say I have an object with 3 boolean fields:
I want it to be valid when at least one of these 3 fields is true. How do I do it with the changeset validation?
I could make a getter
and validate against that new property.
But it won't work with the changeset because the changes are in the changeset and when the getter is evaluated,
this
contains original object.If I try to define that getter on the Changeset by extending it, its value is just undefined.
Any tips how I can do the desired validation?
The text was updated successfully, but these errors were encountered: