Thus, there seems to be no clean way to general resolution of the Hash field with strong parameters. Of course, this may be a problem with strong parameters, but I'm curious if there is a way around this. I have a model with some fields ...
field :name, type: String field :email, type: String field :other_stuff, type: Hash, default: {}
Now I can simply resolve everything:
params.require(:registration).permit!
But this is not a good idea, and I would like to do something like ...
params.require (: registration) .permit (: name ,: email, {other_stuff: {}})
However, this is not possible with strong parameters, it is impossible to simply reinstall the hash as a property (yay for SQL-oriented ActiveRecord APIs!). Any ideas on how to do this, or is this the best attempt to send a Rails patch to resolve this scenario.
source share