i’m upgrading my 4.2 rails to 5.0. I use dry-validation 0.13.1.
I have a Dry::Validation.Params schema with nested schema like optional(:my_param).schema do .... It is expecting an Array or Hash, but now Rails 5 params/sub-params returns ActionController::Parameters instead of an Hash.
Sorry, right now I have Rails behaviour a bit forgotten. But, if you are sanitizing with Dry::Validation I don’t see why you have to sanitize again with permit. You can just permit everything, call #to_hash and then sanitize with Dry:: Validation.
What cpgo wrote is correct, you need to get back a normal hash from the strong params wrapper object, which is exactly what to_unsafe_hash does. This is fine (despite the name), since you’re going to validate/sanitize it using dry-validation anyway.