Skip to content

Commit

Permalink
deep_symbolize accounts for arrays containing hashes (fixes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
blahah committed Sep 10, 2013
1 parent 6e6369d commit 15a4732
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/biopsy/base_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def deep_symbolize
target = dup
target.inject({}) do |memo, (key, value)|
value = value.deep_symbolize if value.is_a?(Hash)
value = value.map{ |x| x.is_a?(Hash) ? x.deep_symbolize : x } if value.is_a?(Array)
memo[(key.to_sym rescue key) || key] = value
memo
end
Expand Down

0 comments on commit 15a4732

Please sign in to comment.