Skip to content

Instantly share code, notes, and snippets.

@joshfrench
Created January 2, 2010 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshfrench/267367 to your computer and use it in GitHub Desktop.
Save joshfrench/267367 to your computer and use it in GitHub Desktop.
Author.find :all, :joins => 'inner join extensions on extensions.author_id = authors.id', :group => 'authors.id'
# Had to add the :group key to produce a unique set.
# Removing `:include => :extensions` also reduced this from two queries to one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment