<commit_before>class StaticPagesController < ApplicationController
  before_filter :check_access, only: [:createCustomWeights,:generate_matches,:weigh_in]

	def tournaments
		@tournaments = Tournament.all.includes(:user,:matches,:mats)
	end
	def up_matches
		if params[:tournament]
	      @tournament = Tournament.where(:id => params[:tournament]).includes(:matches).first
		end
	    if @tournament
				@matches = @tournament.matches.where(mat_id: nil).order('bout_number ASC').limit(10).includes(:wrestlers)
				@mats = @tournament.mats.includes(:matches)
				if @tournament.matches.empty?
					redirect_to "/static_pages/noMatches?tournament=#{@tournament.id}"
				end
	    end
	end

	def team_scores
		if params[:tournament]
	      @tournament = Tournament.find(params[:tournament])
		end
	    if @tournament
	    	@schools = School.where(tournament_id: @tournament.id)
	    	@schools.sort_by{|x|[x.score]}
	    end
	end

	def results
		if params[:tournament]
	      @tournament = Tournament.find(params[:tournament])
		end<commit_msg>including mats on tournament query<commit_after>class StaticPagesController < ApplicationController
  before_filter :check_access, only: [:createCustomWeights,:generate_matches,:weigh_in]

	def tournaments
		@tournaments = Tournament.all.includes(:user,:matches,:mats)
	end
	def up_matches
		if params[:tournament]
	      @tournament = Tournament.where(:id => params[:tournament]).includes(:matches,:mats).first
		end
	    if @tournament
				@matches = @tournament.matches.where(mat_id: nil).order('bout_number ASC').limit(10).includes(:wrestlers)
				@mats = @tournament.mats.includes(:matches)
				if @tournament.matches.empty?
					redirect_to "/static_pages/noMatches?tournament=#{@tournament.id}"
				end
	    end
	end

	def team_scores
		if params[:tournament]
	      @tournament = Tournament.find(params[:tournament])
		end
	    if @tournament
	    	@schools = School.where(tournament_id: @tournament.id)
	    	@schools.sort_by{|x|[x.score]}
	    end
	end

	def results
		if params[:tournament]
	      @tournament = Tournament.find(params[:tournament])
		end
{'fraction_non_alphanumeric': 0.12268188302425106, 'fraction_numerical': 0.0019020446980504042, 'mean_word_length': 4.5223097112860895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1072247', 'n_tokens_mistral': 798, 'n_tokens_neox': 669, 'n_words': 117}