Another example solution is https://github.com/intridea/hashie#deepfetch (Although I don’t like “fetch” in this method name since it doesn’t and can’t take a default value as an argument like Hash#fetch does)
Would a method like this possibly belong in ActionController::Parameters? Or maybe even in Active Support extensions on Hash (gasp!)? Or is it just an all-around terrible idea?
Adding stuff to AS core extensions has to be done carefully, the criteria
is that it has to be clearly useful either for Rails internals (the main
design driver of AS core extensions), or solve a common need in web
development.
While the quoted questions wonder about nested hashes in Ruby, that doesn't
seem like a strong point for the criteria above.
Also, if the intermediate key has an integer value, should it raise? Would
it create expectations in users about the rest of the API? What about
nested deletion? Nested has_key? Should AC::Parameters respond to all that
as well?