Created
October 17, 2010 00:28
-
-
Save mdeering/630401 to your computer and use it in GitHub Desktop.
team.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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