From b7c360ff885462c941122ae1ff850aca93343260 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 30 Oct 2015 11:24:14 -0400 Subject: [PATCH] Limit to 10 upcoming matches on up_matches --- app/controllers/static_pages_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 7a890d5..9bdb45f 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -9,9 +9,9 @@ class StaticPagesController < ApplicationController @tournament = Tournament.find(params[:tournament]) end if @tournament - @matches = @tournament.matches.where(mat_id: nil) + @matches = @tournament.matches.where(mat_id: nil).limit(10) @mats = @tournament.mats - if @matches.empty? + if @tournament.matches.empty? redirect_to "/static_pages/noMatches?tournament=#{@tournament.id}" end end