<commit_before>FactoryBot.define do
  factory :volunteer do
    birth_year { Faker::Date.birthday(18, 85) }
    contact
    salutation { ['mr', 'mrs'].sample }
    acceptance :accepted

    trait :with_language_skills do
      language_skills do |language_skill|
        Array.new(2) { language_skill.association(:language_skill) }
      end
    end

    trait :with_assignment do
      assignments do |assignment|
        [assignment.association(:assignment, period_start: 300.days.ago, period_end: 20.days.ago)]
      end
    end

    trait :with_journals do
      journals do |journal|
        [
          journal.association(:journal_seed),
          journal.association(:journal_seed),
          journal.association(:journal_seed)
        ]
      end
    end

    trait :seed_contact do
      association :contact, factory: :contact_seed
    end

    trait :external do
      external true
    end

    trait :zuerich do
      association :contact, factory: :contact_zuerich
    end

    trait :faker_extra do
      profession { Faker::Company.profession }
      working_percent { "#{Faker::Number.between(1, 10)}0" }
    end

    trait :fake_single_assignments do
      man { [true, false].sample }
      woman { [true, false].sample }
      family { [true, false].sample }
      kid { [true, false].sample }
      unaccompanied { [true, false].sample }
    end

    trait :fake_group_assignments do
      sport { [true, false].sample }
      creative { [true, false].sample }
      music { [true, false].sample }
      culture { [true, false].sample }
      training { [true, false].sample }
      german_course { [true, false].sample }
      dancing { [true, false].sample }
      health { [true, false].sample }
      cooking { [true, false].sample }
      excursions { [true, false].sample }
      women { [true, false].sample }
      teenagers { [true, false].sample }
      children { [true, false].sample }
      other_offer { [true, false].sample }
    end

    trait :fake_availability do
      flexible { [true, false].sample }
      morning { [true, false].sample }
      afternoon { [true, false].sample }
      evening { [true, false].sample }
      workday { [true, false].sample }
      weekend { [true, false].sample }
    end

    factory :volunteer_external, traits: [:external]
    factory :volunteer_z, traits: [:zuerich]

    factory(
      :volunteer_seed,
      traits: [
        :seed_contact, :with_language_skills, :with_journals, :faker_extra,
        :fake_availability, :fake_single_assignments, :fake_group_assignments
      ]
    )
  end
end<commit_msg>add categories factory for volunteer<commit_after>FactoryBot.define do
  factory :volunteer do
    birth_year { Faker::Date.birthday(18, 85) }
    contact
    salutation { ['mr', 'mrs'].sample }
    acceptance :accepted

    trait :with_language_skills do
      language_skills do |language_skill|
        Array.new(2) { language_skill.association(:language_skill) }
      end
    end

    trait :with_assignment do
      assignments do |assignment|
        [assignment.association(:assignment, period_start: 300.days.ago, period_end: 20.days.ago)]
      end
    end

    trait :with_journals do
      journals do |journal|
        [
          journal.association(:journal_seed),
          journal.association(:journal_seed),
          journal.association(:journal_seed)
        ]
      end
    end

    trait :seed_contact do
      association :contact, factory: :contact_seed
    end

    trait :external do
      external true
    end

    trait :zuerich do
      association :contact, factory: :contact_zuerich
    end

    trait :faker_extra do
      profession { Faker::Company.profession }
      working_percent { "#{Faker::Number.between(1, 10)}0" }
    end

    trait :fake_single_assignments do
      man { [true, false].sample }
      woman { [true, false].sample }
      family { [true, false].sample }
      kid { [true, false].sample }
      unaccompanied { [true, false].sample }
    end

    trait :with_group_offer_categories do
      group_offer_categories do |category|
        category.association(:group_offer_category)
      end
    end

    trait :fake_availability do
      flexible { [true, false].sample }
      morning { [true, false].sample }
      afternoon { [true, false].sample }
      evening { [true, false].sample }
      workday { [true, false].sample }
      weekend { [true, false].sample }
    end

    factory :volunteer_external, traits: [:external]
    factory :volunteer_z, traits: [:zuerich]

    factory(
      :volunteer_seed,
      traits: [
        :seed_contact, :with_language_skills, :with_journals, :faker_extra,
        :fake_availability, :fake_single_assignments
      ]
    )
  end
end
{'fraction_non_alphanumeric': 0.10441767068273092, 'fraction_numerical': 0.005918410484041429, 'mean_word_length': 2.5794251134644477, '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': '4911680', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1454, 'n_words': 337}