1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-29 02:12:59 +00:00

Limit to 10 upcoming matches on up_matches

This commit is contained in:
2015-10-30 11:24:14 -04:00
parent 685c71ade9
commit b7c360ff88

View File

@@ -9,9 +9,9 @@ class StaticPagesController < ApplicationController
@tournament = Tournament.find(params[:tournament]) @tournament = Tournament.find(params[:tournament])
end end
if @tournament if @tournament
@matches = @tournament.matches.where(mat_id: nil) @matches = @tournament.matches.where(mat_id: nil).limit(10)
@mats = @tournament.mats @mats = @tournament.mats
if @matches.empty? if @tournament.matches.empty?
redirect_to "/static_pages/noMatches?tournament=#{@tournament.id}" redirect_to "/static_pages/noMatches?tournament=#{@tournament.id}"
end end
end end