Ruby string's method % allows to substitute name placeholders with the values of the given hash: "Hello %{name}" % {name: "World"} will result with "Hello World".
The problem is that it doesn't work with HashWithIndifferentAccess arguments. In Rails 5 this code would raise an exception:
2.3.8 :001 > "%{a}" % {"a" => 1}.with_indifferent_access
KeyError: key{a} not found
from (irb):1:in `%'
from (irb):1
It's also interesting that the same code works fine in Rails 4 but not in Rails 5
Is there a way to fix it (maybe some monkey-patching of ActiveSupport::HashWithIndifferentAccess) and understand why the behavior of % (and sprintf too) has changed?