Created
May 20, 2019 21:08
-
-
Save Prorok64b/7819117fd9a13a39e5a7c115e9fdd704 to your computer and use it in GitHub Desktop.
sql from relation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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