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.

improve the pretty printing of OrderedHash

#3364

I submitted the same ticket to Rails Guides, sorry.

It seems that the pretty printing of the instance of ActiveSupport::OrderedHash is broken.

>> pp [1, 1].group_by{|i| i}
{[1, [1, 1]]=>nil}
=> nil

After patching:

>> pp [1, 1].group_by{|i| i}
#<OrderedHash {1=>[1, 1]}>

and works correctly even if the hash is larger:

>> pp (1..20).group_by{|i| i % 3}
#<OrderedHash
{1=>[1, 4, 7, 10, 13, 16, 19],
 2=>[2, 5, 8, 11, 14, 17, 20],
 0=>[3, 6, 9, 12, 15, 18]}>
=> nil

Thanks,

Reported by Nobuhiro IMAI · October 11th, 2009 @ 04:44 AM

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

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    October 6th, 2010 @ 06:42 AM