diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-10-14 23:37:49 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-14 23:37:49 -0300 |
commit | 1167df3d11434de80d7e2533dbd1c1177e1805d1 (patch) | |
tree | 52c3d4f2a7de2c31011578efade6e37e9fc81537 | |
parent | 159b774887cfb3d5c862b2b48d24d75b658e47af (diff) | |
parent | e84ed4fd17a9e662d1da647c27ebeffa29c94a01 (diff) | |
download | rails-1167df3d11434de80d7e2533dbd1c1177e1805d1.tar.gz rails-1167df3d11434de80d7e2533dbd1c1177e1805d1.tar.bz2 rails-1167df3d11434de80d7e2533dbd1c1177e1805d1.zip |
Merge pull request #26788 from Jesus/master
Use built-in #transform_values when available.
-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 7d507ac998..a307996980 100644 --- a/activesupport/lib/active_support/core_ext/hash/transform_values.rb +++ b/activesupport/lib/active_support/core_ext/hash/transform_values.rb @@ -16,7 +16,7 @@ class Hash result[key] = yield(value) end result - end + end unless method_defined? :transform_values # Destructively converts all values using the +block+ operations. # Same as +transform_values+ but modifies +self+. @@ -25,5 +25,5 @@ class Hash each do |key, value| self[key] = yield(value) end - end + end unless method_defined? :transform_values! end |