<commit_before>require 'faker'

namespace :scramble do
  desc 'Scramble refugees'
  task refugees: :environment do
    Refugee.find_each do |refugee|
      refugee.name = "#{Faker::Name.first_name} #{Faker::Name.last_name}"
      refugee.date_of_birth = Faker::Time.between(DateTime.now - 18.year, DateTime.now - 4.year).to_s[0..9]
      refugee.ssn_extension = Faker::Number.number(4)
      refugee.ssns = []
      refugee.dossier_number = Faker::Number.number(10)
      refugee.dossier_numbers = []
      refugee.social_worker = ''
      refugee.countries = []
      refugee.languages = []
      refugee.deregistered_comment = ''
      refugee.municipality_placement_comment = ''
      refugee.other_relateds = ''
      refugee.secrecy = false
      refugee.save!
    end
  end

  desc 'Scramble home names'
  task homes: :environment do
    home_names = 1.upto(40).map { Faker::Ancient.titan }
    home_names << 1.upto(40).map { Faker::Ancient.hero }
    home_names << 1.upto(40).map { Faker::Ancient.titan }
    home_names << 1.upto(40).map { Faker::Ancient.primordial }<commit_msg>Scramble countries<commit_after>require 'faker'

namespace :scramble do
  desc 'Scramble refugees'
  task refugees: :environment do
    countries = Country.where(id: [313, 251, 318])

    Refugee.find_each do |refugee|
      refugee.name = "#{Faker::Name.first_name} #{Faker::Name.last_name}"
      refugee.date_of_birth = Faker::Time.between(DateTime.now - 18.year, DateTime.now - 4.year).to_s[0..9]
      refugee.ssn_extension = Faker::Number.number(4)
      refugee.ssns = []
      refugee.dossier_number = Faker::Number.number(10)
      refugee.dossier_numbers = []
      refugee.social_worker = ''
      refugee.countries = [countries[rand(3)]]
      refugee.languages = []
      refugee.deregistered_comment = ''
      refugee.municipality_placement_comment = ''
      refugee.other_relateds = ''
      refugee.secrecy = false
      refugee.save!
    end
  end

  desc 'Scramble home names'
  task homes: :environment do
    home_names = 1.upto(40).map { Faker::Ancient.titan }
    home_names << 1.upto(40).map { Faker::Ancient.hero }
    home_names << 1.upto(40).map { Faker::Ancient.titan }
    home_names << 1.upto(40).map { Faker::Ancient.primordial }
{'fraction_non_alphanumeric': 0.1348464619492657, 'fraction_numerical': 0.022251891410769914, 'mean_word_length': 3.2900763358778624, 'pattern_counts': {'":': 0, '<': 15, '<?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': '1271733', 'n_tokens_mistral': 848, 'n_tokens_neox': 812, 'n_words': 127}