public
Fork of NZKoz/koz-rails
Description: Koz's rails git-svn clone
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/eventualbuddha/koz-rails.git
2-0-stable: Add OrderedHash#to_hash References #11266 [josh]


git-svn-id: 
http://svn-commit.rubyonrails.org/rails/branches/2-0-stable@8973 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
nzkoz (author)
Sun Mar 02 19:30:57 -0800 2008
commit  97af9e30809ed3eae76a190dbf904204c8a8b1c9
tree    796eb6df26080a5ecd343ee7d8076f2f702eb5ad
parent  d610c3e10a88d1d3afa29b7e655a6291468afbcc
...
26
27
28
 
 
 
 
 
 
29
30
31
...
26
27
28
29
30
31
32
33
34
35
36
37
0
@@ -26,6 +26,12 @@ module ActiveSupport
0
       def values
0
         collect { |key, value| value }
0
       end
0
+
0
+ def to_hash
0
+ returning({}) do |hash|
0
+ each { |array| hash[array[0]] = array[1] }
0
+ end
0
+ end
0
     end
0
   end
0
 end
...
22
23
24
 
25
26
27
...
22
23
24
25
26
27
28
0
@@ -22,6 +22,7 @@ class EnumerableTests < Test::Unit::TestCase
0
     end
0
 
0
     assert_equal objects.uniq.map(&:name), grouped.keys
0
+ assert({}.merge(grouped), "Could not convert ActiveSupport::OrderedHash into Hash")
0
   end
0
 
0
   def test_sums

Comments

    No one has commented yet.