Skip to content
Browse files

Merge pull request #411 from viking/remove-stringify-keys-use

Remove use of stringify_keys in OmniAuth::Configuration#add_mock
  • Loading branch information...
2 parents 43ef8d9 + 609bc7d commit e01584408b710281005311a4583039a6c81c10ab Michael Bleigh committed Sep 3, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 oa-core/lib/omniauth/core.rb
View
12 oa-core/lib/omniauth/core.rb
@@ -55,10 +55,14 @@ def on_failure(&block)
def add_mock(provider, mock={})
# Stringify keys recursively one level.
- mock.stringify_keys!
- mock.keys.each do|key|
- if mock[key].is_a? Hash
- mock[key].stringify_keys!
+ mock.keys.each do |key|
+ mock[key.to_s] = mock.delete(key)
+ end
+ mock.each_pair do |key, val|
+ if val.is_a? Hash
+ val.keys.each do |subkey|
+ val[subkey.to_s] = val.delete(subkey)
+ end
end
end

0 comments on commit e015844

Please sign in to comment.
Something went wrong with that request. Please try again.