Skip to content
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

enable_defaults can (optionally) not roll-back on an error #16

Open
greglearns opened this issue Apr 20, 2015 · 1 comment
Open

enable_defaults can (optionally) not roll-back on an error #16

greglearns opened this issue Apr 20, 2015 · 1 comment

Comments

@greglearns
Copy link

enable_defaults is awesome. Thank you!

But, is it possible to add a flag so that you can give it an invalid (or empty) object, and it would add all of the default values to the object? This would be helpful for populating a UI with the initial default values before a validation is done.

@atrniv
Copy link
Member

atrniv commented Aug 1, 2015

Hi @greglearns, I believe this is already the case. I've also given some examples of this in the documentation of the behavior of defaults in the README file, where any empty object is populated with default values. Please let me know if I've understood you correctly and if that example in the README file is the same as what you are talking about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants