aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/indifferent_access.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/indifferent_access.rb8
1 files changed, 8 insertions, 0 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 458f8961a3..c96e63b169 100644
--- a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
+++ b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
@@ -41,6 +41,14 @@ class HashWithIndifferentAccess < Hash
indices.collect {|key| self[convert_key(key)]}
end
+ def dup
+ HashWithIndifferentAccess.new(self)
+ end
+
+ def merge(hash)
+ self.dup.update(hash)
+ end
+
protected
def convert_key(key)
key.kind_of?(Symbol) ? key.to_s : key