<commit_before>module Voluntary
  module Test
    module RspecHelpers
      class Factories
        def self.code
          Proc.new do |factory_girl|
            factory_girl.factory :user do
              sequence(:name) { |n| "user#{n}#{r_str}" }
              sequence(:email) { |n| "user#{n}#{<EMAIL>" }
              first_name 'Mister'
              last_name { |u| u.name.humanize }
              country 'Germany'
              language 'en'
              interface_language 'en'
              password 'password'
              password_confirmation { |u| u.password }
              
              #after_create do |user|
              #  User.confirm_by_token(user.confirmation_token)
              #end
            end
            
            factory_girl.factory :area do
              sequence(:name) { |n| "area #{n}" }
            end
            
            factory_girl.factory :product do
              name 'Product'
              user_id FactoryGirl.create(:user, password: 'password', password_confirmation: 'password').id
              area_ids [Area.first.try(:id) || FactoryGirl.create(:area).id]
              text Faker::Lorem.sentences(5).join(' ')
              
              after_build do |product|
                product.id = product.name.to_s.parameterize
              end
            end
            
            factory_girl.factory :organization do
              association :user
              sequence(:name) { |n| "area #{n}" }
            end
            <commit_msg>Fix for strange bug.<commit_after>module Voluntary
  module Test
    module RspecHelpers
      class Factories
        def self.code
          Proc.new do |factory_girl|
            factory_girl.factory :user do
              sequence(:name) { |n| "user#{n}#{r_str}" }
              sequence(:email) { |n| "user#{n}<EMAIL>" }
              first_name 'Mister'
              last_name { |u| u.name.humanize }
              country 'Germany'
              language 'en'
              interface_language 'en'
              password 'password'
              password_confirmation { |u| u.password }
              
              #after_create do |user|
              #  User.confirm_by_token(user.confirmation_token)
              #end
            end
            
            factory_girl.factory :area do
              sequence(:name) { |n| "area #{n}" }
            end
            
            factory_girl.factory :product do
              name 'Product'
              user_id { FactoryGirl.create(:user, password: 'password', password_confirmation: 'password').id }
              area_ids { [Area.first.try(:id) || FactoryGirl.create(:area).id] }
              text Faker::Lorem.sentences(5).join(' ')
              
              after_build do |product|
                product.id = product.name.to_s.parameterize
              end
            end
            
            factory_girl.factory :organization do
              association :user
              sequence(:name) { |n| "area #{n}" }
            end
            
{'fraction_non_alphanumeric': 0.09785831960461285, 'fraction_numerical': 0.0006589785831960461, 'mean_word_length': 1.3480278422273781, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3945301', 'n_tokens_mistral': 795, 'n_tokens_neox': 786, 'n_words': 173}