You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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.
@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!
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?
The text was updated successfully, but these errors were encountered: