<commit_before><table class="table table-bordered table-striped table-condensed">
  <thead>
    <tr>
      <th class="span1">Application</th>
      <th class="span1">Has access?</th>
      <th class="span1">Other Permissions</th>
      <th class="span2">Last synced at</th>
    </tr>
  </thead>
  <tbody>
    <% applications_and_permissions(user_object).each_with_index do |(application, permission), index| %>
      <tr>
        <td>
          <%= application.name %>
          <%= hidden_field_tag "user[permissions_attributes][#{index}][application_id]", application.id %>
          <%= hidden_field_tag "user[permissions_attributes][#{index}][id]", permission.id %>
        </td>
        <td>
          <!-- Emulate form.check_box helper http://api.rubyonrails.org/v3.1.3/classes/ActionView/Helpers/FormHelper.html#method-i-check_box -->
          <%= hidden_field_tag "user[permissions_attributes][#{index}][signin_permission]", "0" %>
          <%= label_tag "user[permissions_attributes][#{index}][signin_permission]", "Has access to #{application.name}?", class: "visuallyhidden" %>
          <%= check_box_tag "user[permissions_attributes][#{index}][signin_permission]", "1", permission.permissions.include?("signin") %>
        </td>
        <td>
          <%= label_tag "user[permissions_attributes][#{index}][permissions][]", "Permissions for #{application.name}", class: "visuallyhidden" %>
          <%= select_tag "user[permissions_attributes][#{index}][permissions][]", options_for_select(application.supported_permission_strings - ["signin"], permission.permissions - ["signin"]), multiple: true, class: "chzn-select", "data-placeholder" => "Start typing to search for permissions" %>
        </td>
        <td>
          <% if permission.last_synced_at %>
            <% if permission.sync_needed? %>
              <span class="label label-important"><%= time_ago_in_words(permission.last_synced_at) %> ago</span>
            <% else %>
              <span class="label label-success"><%= time_ago_in_words(permission.last_synced_at) %> ago</span>
            <% end %>
          <% else %>
            <span class="label label-important">Never</span>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table><commit_msg>Only show 'synced' column for existing users<commit_after><table class="table table-bordered table-striped table-condensed">
  <thead>
    <tr>
      <th class="span1">Application</th>
      <th class="span1">Has access?</th>
      <th class="span1">Other Permissions</th>
      <% if user_object.persisted? %>
        <th class="span2">Last synced at</th>
      <% end %>
    </tr>
  </thead>
  <tbody>
    <% applications_and_permissions(user_object).each_with_index do |(application, permission), index| %>
      <tr>
        <td>
          <%= application.name %>
          <%= hidden_field_tag "user[permissions_attributes][#{index}][application_id]", application.id %>
          <%= hidden_field_tag "user[permissions_attributes][#{index}][id]", permission.id %>
        </td>
        <td>
          <!-- Emulate form.check_box helper http://api.rubyonrails.org/v3.1.3/classes/ActionView/Helpers/FormHelper.html#method-i-check_box -->
          <%= hidden_field_tag "user[permissions_attributes][#{index}][signin_permission]", "0" %>
          <%= label_tag "user[permissions_attributes][#{index}][signin_permission]", "Has access to #{application.name}?", class: "visuallyhidden" %>
          <%= check_box_tag "user[permissions_attributes][#{index}][signin_permission]", "1", permission.permissions.include?("signin") %>
        </td>
        <td>
          <%= label_tag "user[permissions_attributes][#{index}][permissions][]", "Permissions for #{application.name}", class: "visuallyhidden" %>
          <%= select_tag "user[permissions_attributes][#{index}][permissions][]", options_for_select(application.supported_permission_strings - ["signin"], permission.permissions - ["signin"]), multiple: true, class: "chzn-select", "data-placeholder" => "Start typing to search for permissions" %>
        </td>
        <% if user_object.persisted? %>
          <td>
            <% if permission.last_synced_at %>
              <% if permission.sync_needed? %>
                <span class="label label-important"><%= time_ago_in_words(permission.last_synced_at) %> ago</span>
              <% else %>
                <span class="label label-success"><%= time_ago_in_words(permission.last_synced_at) %> ago</span>
              <% end %>
            <% else %>
              <span class="label label-important">Never</span>
            <% end %>
          </td>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>
{'fraction_non_alphanumeric': 0.17189166133503944, 'fraction_numerical': 0.003838771593090211, 'mean_word_length': 3.146772767462423, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 111, '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': '2395757', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1406, 'n_words': 233}