summaryrefslogtreecommitdiff
path: root/app/models/tournament.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-07 01:25:12 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-07 01:25:12 -0500
commitf69fcc28596700c1a875068b7cb616d6eb40e6df (patch)
treec11b97401a620f2dd7df5ae4b9645111065b0a8a /app/models/tournament.rb
parentfd213819fa004209fc466b19ee65d83b1f918068 (diff)
It is 1:30 AM
Diffstat (limited to 'app/models/tournament.rb')
-rw-r--r--app/models/tournament.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index ead9205..79d8b24 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -16,7 +16,7 @@ class Tournament < ActiveRecord::Base
unless joinable_by?(user)
return false
end
- players<<user
+ players.push(user)
end
def setup(tournament)
@@ -28,7 +28,7 @@ class Tournament < ActiveRecord::Base
match_num = 0
team_num = 0
self.players.each_slice(tournament.max_players_per_team) do |players|
- self.matches[match_num].teams[team_num] = Team.new(users: players)
+ self.matches[match_num].teams.push(Team.create(users: players))
if (team_num == 0 and team_num % tournament.max_teams_per_match == 0)
match_num += 1
team_num = 0