1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #26895 from yui-knk/use_same_class_on_transform_values

Ensure `#transform_values` of HWIDA to return HWIDA
This commit is contained in:
Guillermo Iguaran 2016-10-25 21:59:17 -05:00 committed by GitHub
commit 634741d972

View file

@ -273,6 +273,11 @@ module ActiveSupport
dup.tap { |hash| hash.reject!(*args, &block) }
end
def transform_values(*args, &block)
return to_enum(:transform_values) unless block_given?
dup.tap { |hash| hash.transform_values!(*args, &block) }
end
# Convert to a regular hash with string keys.
def to_hash
_new_hash = Hash.new