Alternative to James Shorr:
posts = Post.order('created_at DESC').limit(10)
The advantage of this alternative is that it allows you to continue linking more relational areas at the end:
posts.where(:user_id => 1)
This is not until the object is renamed or inspect ed, which actually executes the SQL query.
source share