aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG4
-rw-r--r--activesupport/lib/active_support/core_ext/hash/keys.rb8
2 files changed, 5 insertions, 7 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 67da6f2379..0f9316c097 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,3 +1,7 @@
+*SVN*
+
+* Refactor of Hash#symbolize_keys! to use Hash#replace. Closes #10420 [ReinH]
+
* Fix HashWithIndifferentAccess#to_options! so it doesn't clear the options hash. Closes #10419 [ReinH]
*2.0.1* (December 7th, 2007)
diff --git a/activesupport/lib/active_support/core_ext/hash/keys.rb b/activesupport/lib/active_support/core_ext/hash/keys.rb
index 4d32a6b8a5..2bd4138be4 100644
--- a/activesupport/lib/active_support/core_ext/hash/keys.rb
+++ b/activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -31,13 +31,7 @@ module ActiveSupport #:nodoc:
# Destructively convert all keys to symbols.
def symbolize_keys!
- keys.each do |key|
- unless key.is_a?(Symbol) || (new_key = key.to_sym).nil?
- self[new_key] = self[key]
- delete(key)
- end
- end
- self
+ self.replace(self.symbolize_keys)
end
alias_method :to_options, :symbolize_keys