<commit_before>namespace :'2018_02_13_fill_champ_private_and_type' do
  task set: :environment do
    Champ.includes(:type_de_champ).find_each do |champ|
      champ.update_columns(champ.type_de_champ.params_for_champ)
    end

    TypeDeChamp.find_each do |type_de_champ|
      type_de_champ.update_columns(
        private: type_de_champ.private?,
        type: TypeDeChamp.type_champ_to_class_name(type_de_champ.type_champ)
      )
    end
  end
end
<commit_msg>some old champ live in a parallel space time continuum without valid dossier or type_de_champ<commit_after>namespace :'2018_02_13_fill_champ_private_and_type' do
  task set: :environment do
    Champ.includes(:type_de_champ).find_each do |champ|
      if champ.type_de_champ.present?
        champ.update_columns(champ.type_de_champ.params_for_champ)
      end
    end

    TypeDeChamp.find_each do |type_de_champ|
      type_de_champ.update_columns(
        private: type_de_champ.private?,
        type: TypeDeChamp.type_champ_to_class_name(type_de_champ.type_champ)
      )
    end
  end
end

{'fraction_non_alphanumeric': 0.06886792452830189, 'fraction_numerical': 0.01509433962264151, 'mean_word_length': 4.004716981132075, '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': '5039895', 'n_tokens_mistral': 404, 'n_tokens_neox': 391, 'n_words': 63}