From f618b0aa7c65f1fd9bba61417690f8fbc85bc6c7 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Thu, 30 Jan 2014 10:03:31 -0500 Subject: [PATCH] Fixed up_matches and results to filter by tournament_id --- app/controllers/static_pages_controller.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 5449549..897df43 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -8,18 +8,19 @@ class StaticPagesController < ApplicationController @tournament = Tournament.find(params[:tournament]) end if @tournament - @matches = Weight.where(tournament_id: @tournament.id) + @matches = Match.where(tournament_id: @tournament.id) end - @matches = Match.where(finished: nil) + @matches = @matches.where(finished: nil) + end def results if params[:tournament] @tournament = Tournament.find(params[:tournament]) end if @tournament - @matches = Weight.where(tournament_id: @tournament.id) + @matches = Match.where(tournament_id: @tournament.id) end - @matches = Match.where(finished: 1) + @matches = @matches.where(finished: 1) end def brackets