diff options
author | nfoy <nfoy@purdue.edu> | 2014-04-22 18:30:11 -0400 |
---|---|---|
committer | nfoy <nfoy@purdue.edu> | 2014-04-22 18:30:11 -0400 |
commit | e44115cf206804f7a22c5f98ba422d9c61ad81a7 (patch) | |
tree | e60532fbbc7639084ca218a196dc4b0e377ba4e7 /app/controllers/matches_controller.rb | |
parent | f4373ec761491213a4c5690ef33832f35cbb5e32 (diff) | |
parent | c0ae56e4974a14433a58951c031d4b4c74f57935 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers/matches_controller.rb')
-rw-r--r-- | app/controllers/matches_controller.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 59f376a..b50aca5 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -1,6 +1,4 @@ class MatchesController < ApplicationController - before_action :set_tournament, only: [:index, :update] - require 'httparty' require 'json' require 'delayed_job' @@ -118,7 +116,7 @@ class MatchesController < ApplicationController # GET /tournaments/1/matches/1 # GET /tournaments/1/matches/1.json def show - if Tournament.find_by_id(@match.tournament_id).game_id == 1 + if @match.tournament_stage.tournament.game_id == 1 file_blue = "blue.yaml" file_purple = "purple.yaml" @blue2 = YAML.load_file(file_blue) @@ -235,11 +233,8 @@ class MatchesController < ApplicationController private # Use callbacks to share common setup or constraints between actions. def set_match - set_tournament - @match = @tournament.matches.find(params[:id]) - end - def set_tournament - @tournament = Tournament.find(params[:tournament_id]) + @match = Match.find(params[:id]) + @tournament = @match.tournament_stage.tournament end # Never trust parameters from the scary internet, only allow the white list through. |