title: How do you order by a custom model method that has no attribute in SQL?
body: <p>Previously I ordered my posts as this:</p>
  
  <pre><code>@posts = Post.find(:all, :order =&gt; "created_at DESC")
  </code></pre>
  
  <p>But now I want to replace <code>created_at</code> with a custom method I wrote in the Post model that gives a number as its result.</p>
  
  <p><strong>My guess:</strong></p>
  
  <pre><code>@posts = Post.find(:all, :order =&gt; "custom_method DESC")
  </code></pre>
  
  <p><i>which fails..</i></p>