-
Notifications
You must be signed in to change notification settings - Fork 62
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
nested models don't get validated #47
Comments
yes couch potato has never done that. it was created before active_model so I didn't have a chance to look at it before implementing anything :) I've only had a few cases so far where I wanted this and I then added a custom validation that would check the nested model's validity.I guess it wouldn't be too hard to create a module that would automate that, though I don't have any plans to add that myself. If something like this was to become part of the library I guess it should be optional as not to break existing code. |
can you give me some pointers where to hook into this? i did not really find out how |
well, you add a class method |
thx, will have a look into this. |
we are currently switching from couchrest_model to couch_potato. while doing this our tests failed because couch_potato is not validating 'nested' models. since this is working with the other framework i am not sure if this complies to the contract of active-model validation or not. i would expect that errors on nested models should also fail the validation of the parent and have their errors collected.
here is an example:
output:
The text was updated successfully, but these errors were encountered: