summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-28 00:17:44 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-28 00:17:44 -0400
commite5f603c8c463e09fee5931d7e00e94e14b819347 (patch)
treeb4a15936a3fc51586448585162e4070d7bb82fc8 /app/models
parentee238dbbca6ee979aa886a4f4cebad41e6f79cce (diff)
parent1fb957aeb5c6eb8ec57ecf28b18479bb47093243 (diff)
Merge branch 'master' of http://github.com/LukeShu/leaguer
Diffstat (limited to 'app/models')
-rw-r--r--app/models/match.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/match.rb b/app/models/match.rb
index d4c0ce5..fa15980 100644
--- a/app/models/match.rb
+++ b/app/models/match.rb
@@ -12,6 +12,7 @@ class Match < ActiveRecord::Base
ok = true
tournament_stage.scoring_method.stats_needed.each do |stat|
ok &= statistics.where(match: self, name: stat).nil?
+ end
ok
end
@@ -19,6 +20,16 @@ class Match < ActiveRecord::Base
winner.players.include? player
end
+ def users
+ ret = []
+ self.teams.each{|t| ret.concat(t.users)}
+ return ret
+ end
+
+ def stats_from(sampling_class)
+ # TODO
+ end
+
def handle_sampling(params)
# TODO
end