Skip to content

Instantly share code, notes, and snippets.

@pjb3
Created January 26, 2012 14:14
Show Gist options
  • Save pjb3/1682951 to your computer and use it in GitHub Desktop.
Save pjb3/1682951 to your computer and use it in GitHub Desktop.
Shouldn't this just be in ActiveSupport?
class Hash
def deep_stringify_keys
stringify_keys.inject({}) do |h, (k,v)|
h[k] = v.is_a?(Hash) ? v.deep_stringify_keys : v
h
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment