Skip to content

Instantly share code, notes, and snippets.

@adahl
Created April 26, 2010 21:12
Show Gist options
  • Save adahl/379939 to your computer and use it in GitHub Desktop.
Save adahl/379939 to your computer and use it in GitHub Desktop.
class Customer < ActiveRecord::Base
has_many :groups
end
class Group < ActiveRecord::Base
belongs_to :customer
has_many :members
has_many :people, :through => :members
end
class Member < ActiveRecord::Base
belongs_to :group
belongs_to :person
end
class Person < ActiveRecord::Base
has_many :members
has_many :groups, :through => :members
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment