This project is archived and is in readonly mode.
[Patch] Fixes OrderedHash.[] constructs a broken hash
Reported by Pete Yandell | May 7th, 2009 @ 08:53 AM | in 2.x
>> Hash[1, 2, 3, 4]
=> {1=>2, 3=>4}
>> Hash[1, 2, 3, 4].keys
=> [1, 3]
>> ActiveSupport::OrderedHash[1, 2, 3, 4]
=> #<OrderedHash {1=>2, 3=>4}>
>> ActiveSupport::OrderedHash[1, 2, 3, 4].keys
TypeError: can't dup NilClass
from /usr/local/ruby-1.8.6-p287/lib/ruby/gems/1.8/gems/activesupport-2.3.1/lib/active_support/ordered_hash.rb:49:in `dup'
from /usr/local/ruby-1.8.6-p287/lib/ruby/gems/1.8/gems/activesupport-2.3.1/lib/active_support/ordered_hash.rb:49:in `keys'
from (irb):4
>>
Comments and changes to this ticket
-
Dougal May 8th, 2009 @ 12:10 AM
- Title changed from OrderedHash.[] constructs a broken hash to [Patch] Fixes OrderedHash.[] constructs a broken hash
- Tag set to activesupport, fix, master, patch
ActiveRecord::OrderedHash.[] method was not available, so ordered keys were never set.
Fixing patch attached.
-
Frederick Cheung May 10th, 2009 @ 04:18 PM
Small nitpick: your test_alternate_initialization test doesn't test anything (i think you've just dropped the assert)
-
Repository May 11th, 2009 @ 07:47 PM
- State changed from new to committed
(from [2bcb2443a9e2140e29799229d6c63a046e149597]) ActiveSupport::OrderedHash[1,2,3,4] creates an OrderedHash instead of a Hash.
[#2615 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
-
Repository May 11th, 2009 @ 07:47 PM
(from [e1854e0b199fba352ddcaa58a3af168e8cc70e3a]) ActiveSupport::OrderedHash[1,2,3,4] creates an OrderedHash instead of a Hash.
[#2615 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 2615 [Patch] Fixes OrderedHash.[] constructs a broken hash [#2615 state:committed]
- 2615 [Patch] Fixes OrderedHash.[] constructs a broken hash [#2615 state:committed]