summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 22:26:37 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 22:26:37 -0500
commit70bae69d731afc5300ffa5b176732ebe27d0810f (patch)
treea9333f5bd536af96a3703cbfb0ada12c175ec945
parent5f2247dd1e701a91fb0359bf7265bdadd5486a60 (diff)
add self as a host to a tourney upon creation
-rw-r--r--app/controllers/tournaments_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 74a1f56..1e26584 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -31,9 +31,9 @@ class TournamentsController < ApplicationController
# POST /tournaments.json
def create
@tournament = Tournament.new(tournament_params)
-
respond_to do |format|
if @tournament.save
+ @tournament.hosts.push(current_user)
format.html { redirect_to @tournament, notice: 'Tournament was successfully created.' }
format.json { render action: 'show', status: :created, location: @tournament }
else