diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/tournaments_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index d2a2d18..7352e8d 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -21,9 +21,7 @@ class TournamentsController < ApplicationController # GET /tournaments/new def new @games = Game.all - @tournament = Tournament.new(game: Game.find_by_id(params[:game])) - @tournament.status = 0 - @tournament.save + @tournament = Tournament.new(game: Game.find_by_id(params[:game])) end # GET /tournaments/1/edit @@ -40,6 +38,7 @@ class TournamentsController < ApplicationController # POST /tournaments.json def create @tournament = Tournament.new(tournament_params) + @tournament.status = 0 respond_to do |format| if @tournament.save @tournament.hosts.push(current_user) |