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:
parent
63192a76f3
commit
282e2486b6
@ -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?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user