Use Ruby code to sort forum topics instead of SQL.

Postgres doesn’t like sorting GROUP BY results it appears.