public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/josh/rails.git
Fixed the hash.delete :sym (closes #2176) [Stefan Kaes]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4005 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Mon Mar 20 10:53:52 -0800 2006
commit  d15550aeccd5c10d7c734c523116e3da9f4b13e8
tree    474d38be366868e098c52c66bd927cdee21316be
parent  b0189f3f2ffd9de95ba2332cdcfaf48d28081e18
...
1
 
 
 
2
3
4
...
24
25
26
 
27
28
29
...
49
50
51
52
 
 
 
 
 
53
54
55
...
 
1
2
3
4
5
6
...
26
27
28
29
30
31
32
...
52
53
54
 
55
56
57
58
59
60
61
62
0
@@ -1,4 +1,6 @@
0
-# This implementation is HODEL-HASH-9600 compliant
0
+# this class has dubious semantics and we only have it so that
0
+# people can write params[:key] instead of params['key']
0
+
0
 class HashWithIndifferentAccess < Hash
0
   def initialize(constructor = {})
0
     if constructor.is_a?(Hash)
0
@@ -24,6 +26,7 @@ class HashWithIndifferentAccess < Hash
0
     other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
0
     self
0
   end
0
+
0
   alias_method :merge!, :update
0
 
0
   def key?(key)
0
@@ -49,7 +52,11 @@ class HashWithIndifferentAccess < Hash
0
   def merge(hash)
0
     self.dup.update(hash)
0
   end
0
-
0
+
0
+ def delete(key)
0
+ super(convert_key(key))
0
+ end
0
+
0
   protected
0
     def convert_key(key)
0
       key.kind_of?(Symbol) ? key.to_s : key

Comments

    No one has commented yet.