Skip to content

Instantly share code, notes, and snippets.

@tjarmain
Created July 31, 2012 06:34
Show Gist options
  • Save tjarmain/3214280 to your computer and use it in GitHub Desktop.
Save tjarmain/3214280 to your computer and use it in GitHub Desktop.
Fund
has_many :portfolios
Portfolio
belongs_to :fund
has_many :stocks, :through => :portfolios_stocks # join table
portfolios_stocks
belongs_to :portfolio
belongs_to :stocks
Stock
has_many :portfolios, :through => :portfolios_stocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment