diff options
author | Emily <emily@mongodb.com> | 2016-04-12 10:49:07 +0200 |
---|---|---|
committer | Emily <emily@mongodb.com> | 2016-04-12 10:49:07 +0200 |
commit | 64ae9a58ae54d7d036e930e75fac3e4a1ab0052e (patch) | |
tree | e18db7ef7bc2844da0d5fdebe64279953cb40bd4 /activesupport/lib | |
parent | db9bc8097399aab9c866175b12e9e099b6c83ffa (diff) | |
download | rails-64ae9a58ae54d7d036e930e75fac3e4a1ab0052e.tar.gz rails-64ae9a58ae54d7d036e930e75fac3e4a1ab0052e.tar.bz2 rails-64ae9a58ae54d7d036e930e75fac3e4a1ab0052e.zip |
Restore Hash#transform_keys behavior to always return a Hash instance
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/keys.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/keys.rb b/activesupport/lib/active_support/core_ext/hash/keys.rb index 8b2366c4b3..1bfa18aeee 100644 --- a/activesupport/lib/active_support/core_ext/hash/keys.rb +++ b/activesupport/lib/active_support/core_ext/hash/keys.rb @@ -11,7 +11,7 @@ class Hash # hash.transform_keys.with_index { |k, i| [k, i].join } # => {"name0"=>"Rob", "age1"=>"28"} def transform_keys return enum_for(:transform_keys) { size } unless block_given? - result = self.class.new + result = {} each_key do |key| result[yield(key)] = self[key] end |