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.

Add each_key and each_value to ActiveSupport::OrderedHash

#1410

ActiveSupport::OrderedHash currently doesn't have any methods named each_key or each_value. This is a problem since those methods are a part of the Hash interface. The attached patch has an implementation of the two methods together with tests.

Reported by Christoffer Sawicki · November 18th, 2008 @ 10:10 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Henrik Nyh
  2. Roger Nesbitt
    Roger Nesbitt
    • Tag set to patch

    +1 Ran into this problem when we upgraded.

    November 19th, 2008 @ 04:19 PM

  3. Christoffer Sawicki
    Christoffer Sawicki

    I should have mentioned that the absense of these methods can cause breakage when methods return OrderedHashes instead of Hashes, as the case is with the new group_by for example.

    November 19th, 2008 @ 04:36 PM

  4. Repository
    Repository
    • State changed from new to resolved

    (from [05a938c5f7804fd59c76c45df096e6ebff871a18]) Added ActiveSupport::OrderedHash#each_key and ActiveSupport::OrderedHash#each_value [#1410 Add each_key and each_value to ActiveSupport::OrderedHash state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    November 26th, 2008 @ 02:06 PM