diff --git a/activesupport/lib/active_support/core_ext/hash/transform_values.rb b/activesupport/lib/active_support/core_ext/hash/transform_values.rb index 6ff7e9121273b27d7799f27aceacba2c6fa8412b..cebf9e815a9ab84e205d2a2cebf0b3cad892facc 100644 --- a/activesupport/lib/active_support/core_ext/hash/transform_values.rb +++ b/activesupport/lib/active_support/core_ext/hash/transform_values.rb @@ -4,7 +4,7 @@ class Hash # # { a: 1, b: 2, c: 3 }.transform_values { |x| x * 2 } # # => { a: 2, b: 4, c: 6 } - def transform_values(&block) + def transform_values result = self.class.new each do |key, value| result[key] = yield(value)