Skip to content

Instantly share code, notes, and snippets.

@elico
Created November 15, 2012 07:33
Show Gist options
  • Save elico/4077221 to your computer and use it in GitHub Desktop.
Save elico/4077221 to your computer and use it in GitHub Desktop.
#db name:msg
#tables client, queue, templates
#I want to store messages queue and when needed to compose msg from templates.
#I have id field in each one of them
#
# in the queue I have template ID and client ID and I want to use one select to get all the data from both tables.
# so what relationship needed? I kind of go confused with belongs_to and has_many.
# thanks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment