how about using ActiveSupport's transform_keys! method instead of doing recursion by yourself?