Skip to content

Instantly share code, notes, and snippets.

@rubytastic
Created October 6, 2011 09:09
Show Gist options
  • Save rubytastic/1266915 to your computer and use it in GitHub Desktop.
Save rubytastic/1266915 to your computer and use it in GitHub Desktop.
* sessions are like groups, nothing to do with logged in
class Session < ActiveRecord::Base
has_many :participants
has_many :users, :through => :participants
end
class Participant < ActiveRecord::Base
belongs_to :user
belongs_to :session
end
class User < ActiveRecord::Base
has_many :sessions, :through => :participants
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment