diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/transform_values.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/transform_values.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 9ddb838774..7d507ac998 100644 --- a/activesupport/lib/active_support/core_ext/hash/transform_values.rb +++ b/activesupport/lib/active_support/core_ext/hash/transform_values.rb @@ -9,7 +9,7 @@ class Hash # # { a: 1, b: 2 }.transform_values.with_index { |v, i| [v, i].join.to_i } # => { a: 10, b: 21 } def transform_values - return enum_for(:transform_values) unless block_given? + return enum_for(:transform_values) { size } unless block_given? return {} if empty? result = self.class.new each do |key, value| @@ -21,7 +21,7 @@ class Hash # Destructively converts all values using the +block+ operations. # Same as +transform_values+ but modifies +self+. def transform_values! - return enum_for(:transform_values!) unless block_given? + return enum_for(:transform_values!) { size } unless block_given? each do |key, value| self[key] = yield(value) end |