Skip to content

Instantly share code, notes, and snippets.

@Prorok64b
Created May 20, 2019 21:07
Show Gist options
  • Save Prorok64b/0de2a38794194d7ae6c8f623c597af91 to your computer and use it in GitHub Desktop.
Save Prorok64b/0de2a38794194d7ae6c8f623c597af91 to your computer and use it in GitHub Desktop.
first relation
User.includes(:posts)
# produces:
# SELECT * FROM users
# SELECT * FROM posts WHERE posts.user_id IN (...users ids)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment