<commit_before><% @page_title = "Results: #{@racer.name}: #{@competition.name}" %>

<%# TODO Use helper/partial? %>
<h1><%= link_to(@racer.name, :action => 'racer', :id => @racer.to_param) %></h1>

<%- for result in @results.sort { |x, y| y.source_result.date <=> x.source_result.date } -%>
<table class="base">
	<caption>
	  <%= result.place.to_i.ordinalize %> &mdash; 
      <%= link_to(@competition.name + ' ', :action => 'event', :id => @competition.to_param) %>
      <%= link_to(result.race.standings.name + ' ', :action => 'event', :id => @competition.to_param) unless @competition.name == result.race.standings.name %>
      <%= link_to(result.race.name + ' ', :action => 'event', :id => @competition.to_param) unless result.race.name == result.race.standings.name %></th>
	</caption>
	<tr>
		<th></th>
		<th>Race</th>
		<th>Category</th>
		<th>Team</th>
		<th>Date</th>
		<th class="right">Points</th>
	</tr>
	<% for score in result.scores.sort { |x, y| y.source_result.date <=> x.source_result.date } %>
	<tr class="<%= cycle("even", "odd") %>">
		<td class="right" width="24"><%= score.source_result.place %></td>
		<td width="400">
			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'event', :id => score.source_result.race.standings.event.id, :anchor => score.source_result.race.id) unless score.source_result.race.standings.event.is_a?(Competition) %>
			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'competition', :competition_id => score.source_result.race.standings.event.id, :racer_id => @racer.id) if score.source_result.race.standings.event.is_a?(Competition)%></td>
		</td>
		<td width="200"><%= score.source_result.race.name %></td>
		<td width="200"><%= score.source_result.team_name %></td>
		<td width="100"><%= score.source_result.event.date.strftime("%D") %></td><commit_msg>Use result#date for sorting instead of non-existant result#source_result#date<commit_after><% @page_title = "Results: #{@racer.name}: #{@competition.name}" %>

<%# TODO Use helper/partial? %>
<h1><%= link_to(@racer.name, :action => 'racer', :id => @racer.to_param) %></h1>

<%- for result in @results.sort { |x, y| y.date <=> x.date } -%>
<table class="base">
	<caption>
	  <%= result.place.to_i.ordinalize %> &mdash; 
      <%= link_to(@competition.name + ' ', :action => 'event', :id => @competition.to_param) %>
      <%= link_to(result.race.standings.name + ' ', :action => 'event', :id => @competition.to_param) unless @competition.name == result.race.standings.name %>
      <%= link_to(result.race.name + ' ', :action => 'event', :id => @competition.to_param) unless result.race.name == result.race.standings.name %></th>
	</caption>
	<tr>
		<th></th>
		<th>Race</th>
		<th>Category</th>
		<th>Team</th>
		<th>Date</th>
		<th class="right">Points</th>
	</tr>
	<% for score in result.scores.sort { |x, y| y.source_result.date <=> x.source_result.date } %>
	<tr class="<%= cycle("even", "odd") %>">
		<td class="right" width="24"><%= score.source_result.place %></td>
		<td width="400">
			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'event', :id => score.source_result.race.standings.event.id, :anchor => score.source_result.race.id) unless score.source_result.race.standings.event.is_a?(Competition) %>
			<%= link_to(score.source_result.race.standings.full_name, :controller => 'results', :action => 'competition', :competition_id => score.source_result.race.standings.event.id, :racer_id => @racer.id) if score.source_result.race.standings.event.is_a?(Competition)%></td>
		</td>
		<td width="200"><%= score.source_result.race.name %></td>
		<td width="200"><%= score.source_result.team_name %></td>
		<td width="100"><%= score.source_result.event.date.strftime("%D") %></td>
{'fraction_non_alphanumeric': 0.2269170579029734, 'fraction_numerical': 0.008346374543557642, 'mean_word_length': 4.8728943338437976, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 135, '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': '5548627', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1415, 'n_words': 234}