Previously I ordered my posts as this:
@posts = Post.find(:all, :order => \"created_at DESC\")
But now I want to replace created_at
created_at
Well, just Post.find(:all) would return an array of AR objects. So you could use Array.sort_by and pass it a block, and since those records are already fetched, you can access the virtual attribute inside the block that sort_by takes.
Post.find(:all)
RDoc: Enumerable.sort_by