Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#6366

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 = ActiveSupport::OrderedHash.new.merge :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.

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

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. ghorner
  2. cldwalker
    cldwalker
    • Title changed from ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8 to [PATCH] ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8

    February 3rd, 2011 @ 04:42 AM

  3. Repository
    Repository
    • State changed from new to resolved

    February 3rd, 2011 @ 09:28 PM