Skip to content

Instantly share code, notes, and snippets.

@lodestone
Created May 2, 2019 15:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Example of annotating a sql query from Rails
Post.for_user(user).annotate("fetching posts for user ##{user.id}").to_sql
#=> SELECT "posts".* FROM "posts" WHERE ... /* fetching posts for user #123 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment