This project is archived and is in readonly mode.

#6366 ✓resolved

[PATCH] ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8

Reported by ghorner | February 3rd, 2011 @ 04:34 AM

In ruby 1.8.x, ordered hashes don't behave like normal hashes when calling each* methods without a block:

>> {:a => 1}.each
=> #<Enumerable::Enumerator:0x25637c>
>> h = :a => 1
=> #<OrderedHash {:a=>1}>
>> h.each
LocalJumpError: no block given
    ./lib/active_support/ordered_hash.rb:150:in `each'
    ./lib/active_support/ordered_hash.rb:150:in `each'

In ruby 1.9, the above works fine for ordered hashes.

Comments and changes to this ticket

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=""></a>

People watching this ticket



Referenced by