title: MongoDB/Mongoid: sorting by referenced document's ID
body: <p>I have 2 classes in Mongoid: Topic &amp; Post. Topic references many posts. </p>
  
  <p>I want to order topics by post's id descending, so that the most recent post is at the top.</p>
  
  <pre><code>@topics = Topic.order_by(:last_message.created_at.desc)
  </code></pre>
  
  <p>This obviously doesn't work.</p>
  
  <p>Is there a way to do that?</p>