1

有没有办法使您在 Ruby On Rails 中处理的所有哈希都成为 HashWithIndiffergentAccess?有很多次我尝试使用符号而不是字符串来访问哈希,例如 Model.attributes。

谢谢!

4

1 回答 1

2
::Hash = HashWithIndifferentAccess

不过,这是个非常糟糕的主意。

于 2012-12-31T02:54:15.310 回答