<commit_before><% title t(:physical_racks) %>

<div class="grid_9 center">

<%= action_links do %>
  <%= link_to t(:new_physical_rack), new_physical_rack_path %>
<% end %>

<table class="pretty list physical_racks">
<thead>
  <tr>
    <th><%= t(:site) %></th>
    <th><%= t(:name) %></th>
    <th><%= t(:servers) %></th>
    <th><%= t(:stock) %>?</th>
    <th></th>
  </tr>
</thead>
<tbody class="long-list">
<% @physical_racks.each do |physical_rack| %>
  <tr>
    <td><%= physical_rack.site %></td>
    <td><%= link_to physical_rack.name, edit_physical_rack_path(physical_rack) %></td>
    <td class="center"><%= @servers_count[physical_rack.id.to_s] || 0 %></td>
    <td class="stock center"><%= "&#149;".html_safe if physical_rack.stock? %></td>
    <td><%= link_to_delete physical_rack %></td>
  </tr>
<% end %>
<% if @servers_count[nil] %>
  <tr>
    <td colspan="2"><em><%= t(:unknown) %></em></td>
    <td class="center"><%= @servers_count[nil] %></td>
    <td></td>
    <td></td>
  </tr>
<% end %>
</tbody>
</table>
<commit_msg>Use PhysicalRack#site_name instead of PhysicalRack#site.name for better performance<commit_after><% title t(:physical_racks) %>

<div class="grid_9 center">

<%= action_links do %>
  <%= link_to t(:new_physical_rack), new_physical_rack_path %>
<% end %>

<table class="pretty list physical_racks">
<thead>
  <tr>
    <th><%= t(:site) %></th>
    <th><%= t(:name) %></th>
    <th><%= t(:servers) %></th>
    <th><%= t(:stock) %>?</th>
    <th></th>
  </tr>
</thead>
<tbody class="long-list">
<% @physical_racks.each do |physical_rack| %>
  <tr>
    <td><%= physical_rack.site_name %></td>
    <td><%= link_to physical_rack.name, edit_physical_rack_path(physical_rack) %></td>
    <td class="center"><%= @servers_count[physical_rack.id.to_s] || 0 %></td>
    <td class="stock center"><%= "&#149;".html_safe if physical_rack.stock? %></td>
    <td><%= link_to_delete physical_rack %></td>
  </tr>
<% end %>
<% if @servers_count[nil] %>
  <tr>
    <td colspan="2"><em><%= t(:unknown) %></em></td>
    <td class="center"><%= @servers_count[nil] %></td>
    <td></td>
    <td></td>
  </tr>
<% end %>
</tbody>
</table>

{'fraction_non_alphanumeric': 0.2563983248022336, 'fraction_numerical': 0.005583992554676594, 'mean_word_length': 4.256723716381418, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 127, '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': '6599060', 'n_tokens_mistral': 946, 'n_tokens_neox': 851, 'n_words': 171}