<commit_before># frozen_string_literal: true

namespace :domains do
  desc 'Check validity of all sheets'
  task migrate_options: :environment do
    Domain.find_each do |domain|
      domain.deprecated_options.each do |option|
        domain_option = domain.domain_options.create(
          name: option[:name],
          value: option[:value],
          description: option[:description],
          site_id: option[:site_id],
          missing_code: (option[:missing_code] == '1'),
          archived: false
        )
        domain_option.add_domain_option! unless domain_option.new_record?
      end
    end
  end

  task size: :environment do
    Domain.find_each do |domain|
      if domain.deprecated_options.size != domain.domain_options.size
        puts domain.name
        puts domain.deprecated_options
        puts domain.domain_options.inspect
      end
    end
  end

  task valid: :environment do
    DomainOption.find_each do |o|
      puts o.inspect unless o.valid?
    end
  end
end<commit_msg>Removed unused domain rake tasks<commit_after># frozen_string_literal: true

namespace :domains do
  desc 'Check validity of all sheets'
  task migrate_options: :environment do
    Domain.find_each do |domain|
      domain.deprecated_options.each do |option|
        domain_option = domain.domain_options.create(
          name: option[:name],
          value: option[:value],
          description: option[:description],
          site_id: option[:site_id],
          missing_code: (option[:missing_code] == '1'),
          archived: false
        )
        domain_option.add_domain_option! unless domain_option.new_record?
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08348348348348349, 'fraction_numerical': 0.0012012012012012011, 'mean_word_length': 2.7354260089686098, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3269875', 'n_tokens_mistral': 476, 'n_tokens_neox': 471, 'n_words': 123}