From fea1311388477583b31fa3214a7241a7322f494a Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 7 Apr 2014 03:35:49 -0400 Subject: Updated Generate and Re-added hoooks --- app/controllers/matches_controller.rb | 11 ++++++----- generate.sh | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index fc44e35..9c0a740 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -147,11 +147,12 @@ class MatchesController < ApplicationController if (@match.status == 1) @scores = @match.scores end - file_blue = "blue.yaml" - file_purple = "purple.yaml" - @blue2 = YAML.load_file(file_blue) - @purp2 = YAML.load_file(file_purple) - + if Tournament.find_by_id(@match.tournament_id).game_id == 1 + file_blue = "blue.yaml" + file_purple = "purple.yaml" + @blue2 = YAML.load_file(file_blue) + @purp2 = YAML.load_file(file_purple) + end end def update diff --git a/generate.sh b/generate.sh index e3e07f9..92e8299 100755 --- a/generate.sh +++ b/generate.sh @@ -17,7 +17,7 @@ bundle exec rails generate delayed_job:active_record # The whole shebang, models, views, and controllers bundle exec rails generate scaffold server default_user_permissions:integer -bundle exec rails generate scaffold match status:integer tournament:references name:string winner:references remote_id:string +bundle exec rails generate scaffold match status:integer tournament:references name:string winner:references remote_id:string submitted_peer_evaluations:integer bundle exec rails generate scaffold team match:references bundle exec rails generate scaffold alert author:references message:text bundle exec rails generate scaffold pm author:references recipient:references message:text -- cgit v1.2.3-2-g168b