Skip to content

Instantly share code, notes, and snippets.

Created January 27, 2019 21:23
What would you like to do?
Rails joins
Post.joins(:users).where(users: { country_code: 'PL' }).map { |post| post.title }
# SELECT "posts".* FROM "posts" INNER JOIN "users" ON "posts"."user_id" = "users"."id" WHERE "users"."country_code" = $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment