diff options
author | Marcel Molina <marcel@vernix.org> | 2006-01-08 21:29:47 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-01-08 21:29:47 +0000 |
commit | 36fc181a575d2c300742a41abd45d7b1a7207288 (patch) | |
tree | 4c111de2fd513bbbdb14cef6ae4781ac83b80cde /activesupport/lib | |
parent | b30ccefe6f143e2c907f9cfc71b251cdd88ba7af (diff) | |
download | rails-36fc181a575d2c300742a41abd45d7b1a7207288.tar.gz rails-36fc181a575d2c300742a41abd45d7b1a7207288.tar.bz2 rails-36fc181a575d2c300742a41abd45d7b1a7207288.zip |
Make HashWithIndifferentAccess#update behave like Hash#update by returning the hash. Closes #3419, #3425
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/indifferent_access.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb index d818d86a09..458f8961a3 100644 --- a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +++ b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb @@ -18,9 +18,12 @@ class HashWithIndifferentAccess < Hash def []=(key, value) regular_writer(convert_key(key), convert_value(value)) end - def update(hash) - hash.each {|key, value| self[key] = value} + + def update(other_hash) + other_hash.each {|key, value| self[key] = value} + self end + alias_method :merge!, :update def key?(key) super(convert_key(key)) |