<commit_before><section class="widget" ng-controller="RulesCtrl">
<%= form_for([current_project, @rule]) do |f| %>
  <% if @rule.errors.any? %>
    <div id="error_explanation">
      <ul>
        <% @rule.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
  
    <div class="field top-buffer">
      <%= f.label :instrument, 'Instrument' %> <br />
      <%= f.select :instrument_id, current_project.instruments.all.collect {|i| [ i.title, i.id ] }, class: 'form-control' %>
    </div>

    <div class="field top-buffer">
      <%= f.label :rule_type, 'Rule Type' %> <br />
      <select
        chosen
        class="select2-container select-block-level"
        data-placeholder="Select a rule type..."
        no-results-text="'This does not match any valid rule type'"
        name="rule[rule_type]"
        id="rule-type"
        ng-model="currentRuleType"
        ng-options="type for type in ruleTypes()"
        required
        >
          <option value=""><option>
        </select>
    </div>

    <div class="field top-buffer" ng-show="currentRuleType == 'INSTRUMENT_SURVEY_LIMIT_RULE'">
      Max Surveys: <input type="text" ng-model="maxSurveys">
      <input id="rule_rule_params" name="rule[rule_params]" type="hidden" value="{&quot;max_surveys&quot;: {{ maxSurveys }} }">
    </div><commit_msg>Set rule type to constant name instead of array index of rule types<commit_after><section class="widget" ng-controller="RulesCtrl">
<%= form_for([current_project, @rule]) do |f| %>
  <% if @rule.errors.any? %>
    <div id="error_explanation">
      <ul>
        <% @rule.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
  
    <div class="field top-buffer">
      <%= f.label :instrument, 'Instrument' %> <br />
      <%= f.select :instrument_id, current_project.instruments.all.collect {|i| [ i.title, i.id ] }, class: 'form-control' %>
    </div>

    <div class="field top-buffer">
      <%= f.label :rule_type, 'Rule Type' %> <br />
      <select
        chosen
        class="select2-container select-block-level"
        data-placeholder="Select a rule type..."
        no-results-text="'This does not match any valid rule type'"
        id="rule-type"
        ng-model="currentRuleType"
        ng-options="type as type for type in ruleTypes()"
        required
        >
          <option value=""><option>
        </select>
        <input id="rule_rule_type" name="rule[rule_type]" type="hidden" value="{{ currentRuleType }}">
    </div>

    <div class="field top-buffer" ng-show="currentRuleType == 'INSTRUMENT_SURVEY_LIMIT_RULE'">
      Max Surveys: <input type="text" ng-model="maxSurveys">
      <input id="rule_rule_params" name="rule[rule_params]" type="hidden" value="{&quot;max_surveys&quot;: {{ maxSurveys }} }">
    </div>
{'fraction_non_alphanumeric': 0.17632850241545894, 'fraction_numerical': 0.0006901311249137336, 'mean_word_length': 2.7796610169491527, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 0, '>': 64, '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': '5500292', 'n_tokens_mistral': 989, 'n_tokens_neox': 938, 'n_words': 202}