summaryrefslogtreecommitdiff
path: root/app/models/team.rb
blob: 90981da4d8c3eb86d8fb5f5f075d8d2a75e95d1b (plain)
1
2
3
4
5
6
7
8
9
10
class Team < ActiveRecord::Base
	has_and_belongs_to_many :matches
	has_and_belongs_to_many :users

	alias_attribute :players, :users

	def owned_by?(user)
		self.users.include?(user)
	end
end