<commit_before>class ConvertToActiveStorage < ActiveRecord::Migration[7.0]
  require 'open-uri'

  def up
    models = [Project, Keyword]
    transaction do
      models.each do |model|
        model.find_each.each do |instance|
          next if instance.send('avatar_file_name').blank?

          blob = ActiveStorage::Blob.create(key: SecureRandom.uuid,
                                            filename: instance.send('avatar_file_name'),
                                            content_type: instance.send('avatar_content_type'),
                                            metadata: {},
                                            service_name: 'local',
                                            byte_size: instance.send('avatar_file_size'),<commit_msg>Add some debugging<commit_after>class ConvertToActiveStorage < ActiveRecord::Migration[7.0]
  require 'open-uri'

  def up
    models = [Project, Keyword]
    transaction do
      models.each do |model|
        model.find_each.each do |instance|
          next if instance.send('avatar_file_name').blank?
	  puts "converting #{instance.class.name} with id #{instance.id}"
          blob = ActiveStorage::Blob.create(key: SecureRandom.uuid,
                                            filename: instance.send('avatar_file_name'),
                                            content_type: instance.send('avatar_content_type'),
                                            metadata: {},
                                            service_name: 'local',
                                            byte_size: instance.send('avatar_file_size'),
{'fraction_non_alphanumeric': 0.09023024268823895, 'fraction_numerical': 0.002489110143123833, 'mean_word_length': 1.4891640866873066, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2364580', 'n_tokens_mistral': 359, 'n_tokens_neox': 353, 'n_words': 73}