From: larry Date: 2006-03-10T01:03:43+09:00 Subject: Re: nuby question: sorting with nils Actually, the weird thing is that the dates were never nil, but the sort thinks they are. Adding the required nil checking code suppressed the exception but the sort is returning things in random order because it sees each date as nil. I posted a followup on the rails list because I thought it might be a rails issue. They suggested I use an explicit sort block instead: @assignments= @assignments.sort {|a,b| a.date <=> b.date} and it works. Not sure why.