Skip to content

Instantly share code, notes, and snippets.

@mdeering
Created October 17, 2010 00:28
Show Gist options
  • Save mdeering/630401 to your computer and use it in GitHub Desktop.
Save mdeering/630401 to your computer and use it in GitHub Desktop.
team.rb
class Team < ActiveRecord::Base
has_many :memberships, :class_name => 'TeamMembership', :before_add => :set_up_team
has_many :players, :through => :memberships, :class_name => 'User', :source => :use
scope :singles, lambda {
# Want to find the teams with only a single membership
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment