diff options
author | nfoy <nfoy@purdue.edu> | 2014-04-28 20:39:47 -0400 |
---|---|---|
committer | nfoy <nfoy@purdue.edu> | 2014-04-28 20:39:47 -0400 |
commit | 82c6b59f4afeba005ef2dc47483873c85fa33ffd (patch) | |
tree | 746c9ca12941a21fc42af802924967d1ff0b6a0d /app/controllers/brackets_controller.rb | |
parent | d2c700eb31e6a81cb5befe2f9dc57afa7fe8dc91 (diff) | |
parent | 1c5930a82f80abff26556e85c71834af9803bc7c (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers/brackets_controller.rb')
-rw-r--r-- | app/controllers/brackets_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/brackets_controller.rb b/app/controllers/brackets_controller.rb index 50ff5fe..ac34bfe 100644 --- a/app/controllers/brackets_controller.rb +++ b/app/controllers/brackets_controller.rb @@ -37,7 +37,7 @@ class BracketsController < ApplicationController @bracket.name = current_user.user_name + "'s Prediction for " + @tournament.name respond_to do |format| - if @tournament.status == 1 && @tournament.stages.first.scheduling_method == "elimination" && @tournament.stages.first.matches.first.status == 0 + if @tournament.status == 1 && @tournament.stages.first.scheduling_method == "elimination" && @tournament.stages.first.matches.first.status < 2 @bracket.save @bracket.create_matches format.html { redirect_to @bracket, notice: 'Bracket was successfully created.' } @@ -54,7 +54,7 @@ class BracketsController < ApplicationController def update respond_to do |format| if @bracket.update(bracket_params) - format.html { redirect_to @bracket, notice: 'Bracket was successfully updated.' } + format.html { redirect_to @tournament, notice: 'Bracket was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } |