1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-31 19:45:45 +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])
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