Previous comparison method failed when the sort column is a date with a Nil. This revision doesn't really sort Nils, rather ignore them.

This commit is contained in:
Robsteranium 2011-12-14 11:26:24 +00:00
parent 63192a76f3
commit 282e2486b6

View File

@ -100,7 +100,7 @@ class ContentType
end
self.contents.where(conditions_with_names)
end).sort { |a, b| (a.send(column) || 0) <=> (b.send(column) || 0) }
end).sort { |a, b| (a.send(column) && b.send(column)) ? (a.send(column) || 0) <=> (b.send(column) || 0) : 0 }
return list if self.order_manually?