Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add method `Amber::Validators::Params#to_unsafe_h` #1043
I've been running my apps with a local patch for a while, with the intention of someday opening a PR, just never got around to it. Looks like @westonganger beat me to it, so I'm adding my two cents now.
Here's my patch:
So I have a second method, my version of
Guess I'd better rename my own #to_unsafe_h to avoid clobbering this new one.
Perhaps I'll re-implement as a boolean flag to #to_h that would allow it to return the values of all declared params, even those that have not passed validation. I would use it to update the model object in memory, to populate the form after an invalid submission (the user shouldn't have to re-enter everything from scratch).
Let me know if that sounds useful and I can open a new PR.