Skip to content

Instantly share code, notes, and snippets.

@bear454
Created June 22, 2009 20:11
Show Gist options
  • Save bear454/134160 to your computer and use it in GitHub Desktop.
Save bear454/134160 to your computer and use it in GitHub Desktop.
class Person < ActiveRecord::Base
has_many :orders
has_many :lines, :through => :products
has_many :products, :through => :lines
end
class Order < ActiveRecord::Base
has_many :lines
has_many :products, :through => :lines
end
class Line < ActiveRecordd::Base
belongs_to :product
end
class Product < ActiveRecord::Base
has_many :lines
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment