<commit_before>class AddOldRatingsFromArchive < ActiveRecord::Migration
  def up
    OldRating.create!({icu_id: 1074, rating: 1821, games:  7, full: true}, without_protection: true)
    OldRating.create!({icu_id: 1305, rating: 1190, games: 30, full: true}, without_protection: true)
    OldRating.create!({icu_id: 2404, rating: 1210, games:  6, full: true}, without_protection: true)
    OldRating.create!({icu_id: 3758, rating: 1507, games: 12, full: true}, without_protection: true)
  end

  def down
    [1305, 2404, 3758].each { |icu_id| OldRating.find_by_icu_id(icu_id).destroy }
  end
end
<commit_msg>Added new old rating for <NAME> 4126<commit_after>class AddOldRatingsFromArchive < ActiveRecord::Migration
  # You can add new records to this migration and rerun it:
  # RAILS_ENV=production bin/rake db:migrate:redo VERSION=20120604061351
  RECORDS =
  [
    {icu_id: 1074, rating: 1821, games:  7, full: true},
    {icu_id: 1305, rating: 1190, games: 30, full: true},
    {icu_id: 2404, rating: 1210, games:  6, full: true},
    {icu_id: 3758, rating: 1507, games: 12, full: true},
    {icu_id: 4126, rating:  938, games: 35, full: true},
  ]

  def up
    RECORDS.each { |hash| OldRating.where(icu_id: hash[:icu_id]).first_or_create(hash, without_protection: true) }
  end

  def down
    RECORDS.each{ |hash| OldRating.find_by_icu_id(hash[:icu_id]).try(:destroy) }
  end
end

{'fraction_non_alphanumeric': 0.12987012987012986, 'fraction_numerical': 0.08297258297258298, 'mean_word_length': 4.661224489795918, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '7246702', 'n_tokens_mistral': 627, 'n_tokens_neox': 526, 'n_words': 136}