Previously I ordered my posts as this :
@posts = Post.find(:all, :order => "created_at DESC")
But now I want to replace created_at
with a custom method I wrote in the Post model that gives a number as its result.
My guess:
@posts = Post.find(:all, :order => "custom_method DESC")
which fails..