<commit_before>class AllotmentController < ApplicationController
  def allot
    ids_to_allot = (5..22).to_a

    alum_to_allot = Alumni.where(:year => '1966')
    # alum_to_allot = (0..619).to_a

    num_to_allot_each = alum_to_allot.count / ids_to_allot.count
    num_to_allot_each = 50

    iterator = 0

    alum_to_allot.each do |alumnus|
      temp = TieAlumniWithStudentMember.new
      # temp.alumni_id        = alumnus.id.to_i
      temp.alumni_id        = alumnus
      studentmember_index = (iterator / num_to_allot_each)
      if studentmember_index >= ids_to_allot.count
        puts 'Overflow!'
      else
        temp.studentmember_id = ids_to_allot[studentmember_index]
        puts temp.alumni_id.to_s + ' alumnus allotted to student member ' + temp.studentmember_id.to_s + ' ' + Student.find(temp.studentmember_id).name
        # temp.save!
      end
      iterator += 1
    end
  end
end<commit_msg>[major] Bug Fix, tie record exists. only update.<commit_after>class AllotmentController < ApplicationController
  def allot
    ids_to_allot = (5..22).to_a

    alum_to_allot = Alumni.where(:year => '1966')
    # alum_to_allot = (0..619).to_a

    num_to_allot_each = alum_to_allot.count / ids_to_allot.count
    num_to_allot_each = 35

    iterator = 0

    alum_to_allot.each do |alumnus|
      temp = TieAlumniWithStudentMember.where(:alumni_id => alumus.id).first
      # temp.alumni_id        = alumnus.id.to_i
      studentmember_index = (iterator / num_to_allot_each)
      if studentmember_index >= ids_to_allot.count
        puts 'Overflow!'
      else
        temp.studentmember_id = ids_to_allot[studentmember_index]
        puts temp.alumni_id.to_s + ' alumnus allotted to student member ' + temp.studentmember_id.to_s
        # temp.save!
      end
      iterator += 1
    end
  end
end
{'fraction_non_alphanumeric': 0.08860759493670886, 'fraction_numerical': 0.01651073197578426, 'mean_word_length': 2.8273684210526318, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '7377067', 'n_tokens_mistral': 684, 'n_tokens_neox': 650, 'n_words': 114}