Skip to content

Instantly share code, notes, and snippets.

@smathy
Created February 24, 2010 18:21
Show Gist options
  • Save smathy/313684 to your computer and use it in GitHub Desktop.
Save smathy/313684 to your computer and use it in GitHub Desktop.
class Factory < AciveRecord::Base
has_many :supplies
has_many :products, :through => :supplies
end
class Product < ActiveRecord::Base
has_many :supplies
has_many :factories, :through => :supplies
end
class Supply < ActiveRecord::Base
belongs_to :product
belongs_to :factory
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment