Skip to content

Instantly share code, notes, and snippets.

@bcamarda
Created July 17, 2012 04:50
Show Gist options
  • Save bcamarda/3127234 to your computer and use it in GitHub Desktop.
Save bcamarda/3127234 to your computer and use it in GitHub Desktop.
Active Record Query
Contact.joins(:addresses).includes(:addresses).where("first_name LIKE 'A%').each do |contact|
puts contact.address.inspect
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment