From: Nico Ritsche Date: 2008-01-29T02:45:08+09:00 Subject: Re: Hash Sorting Nathan Viswa wrote: > Thanks Stefano, Jesus for your time and explanation. Makes sense now. Hi, I'm also trying to sort a hash, but don't succeed for some reason. My hash is build like this: hash['key1'] = array_of_database_records_type_1 hash['key2'] = array_of_database_records_type_2 hash['key3'] = array_of_database_records_type_3 hash['key4'] = array_of_database_records_type_4 .. .. and so on. The hash's data values are arrays of rails active record objects, receifed from a find(:all) call, although their type shouldn't be of importance when sorting by key, as I do: sorted_hash_array = hash.sort The array I receive is not sorted by keys at all, in fact its the same array I get when I call hash.to_a without any sorting. Sitting on this 'simple' problem for a few hours now, having no idea what's the problem. Any ideas? Nico -- Posted via http://www.ruby-forum.com/.