Skip to content

Instantly share code, notes, and snippets.

@don-smith
Created September 4, 2010 23:54
Show Gist options
  • Save don-smith/565605 to your computer and use it in GitHub Desktop.
Save don-smith/565605 to your computer and use it in GitHub Desktop.
class Event < ActiveRecord::Base
has_many :event_users
has_many :producers, :through => :event_users, :source => :user
end
class EventUser < ActiveRecord::Base
belongs_to :user
belongs_to :event
end
class Producer < EventUser
end
class User < ActiveRecord::Base
has_many :event_users
has_many :events, :through => :event_users
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment