aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-04-15 09:25:02 -0600
committerSean Griffin <sean@seantheprogrammer.com>2016-04-15 09:25:02 -0600
commitb0d7ac0ff7462ce1b744411d244cee9074767c0f (patch)
treee97d2f3c543b5f6dde6ff8c80b34fbb9e60c6334 /activesupport/lib/active_support
parent94a1edbc023fd82bf96705d86abc85d2eab14ba3 (diff)
parent64ae9a58ae54d7d036e930e75fac3e4a1ab0052e (diff)
downloadrails-b0d7ac0ff7462ce1b744411d244cee9074767c0f.tar.gz
rails-b0d7ac0ff7462ce1b744411d244cee9074767c0f.tar.bz2
rails-b0d7ac0ff7462ce1b744411d244cee9074767c0f.zip
Merge pull request #24517 from estolfo/transform-keys-return-type-master
Restore Hash#transform_keys behavior to always return a Hash instance
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/keys.rb2
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