I would like to sort forum's users by total_content_length
. To get the top n
writers in the forum I do:
User.order("total_content_length DESC").limit(n)
Now, the problem is when there are two (or more) users with the same total_content_length
.
In this case, I would like to give preference to the user that created a post most recently.
Post
has publisher_id
field (which is a user id
).
How would you do this ?