From: "Peña, Botp" Date: 2008-07-21T12:57:37+09:00 Subject: Re: Grouping/Sorting an Array of objects From: Howard Roberts [mailto:howardroberts@comcast.net] #... # @data.sort{|x,y| Time.parse(x.date) <=> Time.parse(y.date)}).each do # |foo| # puts Foo.date # Still shows date on each loop, but okay # puts Foo.name # [..] # end try, @data.sort_by{|rec| [rec.date, rec.class, rec.name]} or something like that. it would be nice if you can post some sample data so we can test it immediately. i'm a slow typist ;) # To get things in date order, but when I consider mixing a # second object into the array, that confounds matters for me. # I suspect group_by{|item| item.class} may be part of the solution, # but I'm not sure how? that is possible too, but let us take it one at a time ;) kind regards -botp