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

Feature: Validation #37

Open
timscott opened this issue Jun 26, 2014 · 3 comments
Open

Feature: Validation #37

timscott opened this issue Jun 26, 2014 · 3 comments

Comments

@timscott
Copy link

What is the recommended way to handle invalid input (i.e., options)? Reports are kinda like models, but they don't have validation. Maybe it would be good if they did. Otherwise, what I can do when report receives bad options except raise an error, which is pretty ugly for the user?

@adamhunter
Copy link
Member

hey @timscott
I think validation is an interesting idea. I personally haven't had to use it yet because I've followed an approach that provides defaults for all user input if they are not in the proper format. It might be nice to add validation in with some sort of option declaration DSL. I'll be thinking on this over the weekend and will hopefully write something up next week. In the mean time PRs are always welcome.

Thanks for using dossier!

@timscott
Copy link
Author

@adamhunter
Let me know what you ideas you come up with. I spent 10 minutes trying to monkey patch in ActiveModel::Validation, but I gave up right away. If you come up with ideas how to best approach it and share them here, I might can find time to make PR. Thanks!

@nathanl
Copy link
Contributor

nathanl commented Jul 2, 2014

If this is a "niche" feature, it might be best to do it as a separate gem and consider rolling it in later if it's popular enough.

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

3 participants