diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/indifferent_access.rb | 3 |
1 files changed, 2 insertions, 1 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 c96e63b169..adfba0fbf3 100644 --- a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +++ b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb @@ -14,13 +14,14 @@ class HashWithIndifferentAccess < Hash end alias_method :regular_writer, :[]= unless method_defined?(:regular_writer) + alias_method :regular_update, :update unless method_defined?(:regular_update) def []=(key, value) regular_writer(convert_key(key), convert_value(value)) end def update(other_hash) - other_hash.each {|key, value| self[key] = value} + other_hash.each_pair {|key, value| regular_writer(convert_key(key), convert_value(value))} self end alias_method :merge!, :update |