Using Ruby 2.3:
In example 1, the string key "a"
is automatically converted to a symbol, whereas with example 2, it stays a string.
Example 1
{"a": 1}
# => {:a=>1}
Example 2
{"a"=>"c"}
# => {"a"=>"c"}
I thought :
was the same as the old style hash rocket =>
syntax. What is going on? Why have I never noticed this in Rails? Is it the HashWithIndifferentAccess
that is obscuring this?