Skip to content

Instantly share code, notes, and snippets.

@peter
Created May 10, 2010 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peter/396373 to your computer and use it in GitHub Desktop.
Save peter/396373 to your computer and use it in GitHub Desktop.
# => SELECT "posts".* FROM "posts" ORDER BY published DESC, id DESC LIMIT 1
Post.send(:with_scope, {:find => {:order => "id DESC"}}) do
Post.first(:order => "published DESC")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment