<commit_before>require 'factory_girl'

Factory.sequence :email do |n|
  "<EMAIL>"
end

Factory.define :user do |user|
  user.email                 { Factory.next :email }
  user.username              { |u| u.email.split("@").first }
  user.password              "password"
  user.password_confirmation "password"
end

Factory.define :alex, :parent => :user do |user|
  user.username 'alex'
  user.email '<EMAIL>'
end

Factory.define :trip do |trip|
  trip.from  'Barcelona'
  trip.to 'Madrid'
  trip.start '22/11/2009'
  trip.duration 6
  trip.user  {|u| u.association(:user)}
  trip.rides {|r| [r.association(:ride)]} 
  trip.hitchhikes 2
end

Factory.define :ride do |ride|
  ride.title 'Wow, what a ride'
  ride.story 'A crazy new story about hitchhiking'<commit_msg>fix for factories<commit_after>require 'factory_girl'

Factory.sequence :email do |n|
  "<EMAIL>"
end

Factory.define :user do |user|
  user.email                 { Factory.next :email }
  user.username              { |u| u.email.split("@").first }
  user.password              "password"
  user.password_confirmation "password"
end

Factory.define :alex, :parent => :user do |user|
  user.username 'alex'
  user.email '<EMAIL>'
end

Factory.define :trip do |trip|
  trip.from  'Barcelona'
  trip.to 'Madrid'
  trip.start '22/11/2009'
  trip.duration 6
  trip.distance 1646989
  trip.user  {|u| u.association(:user)}
  trip.rides {|r| [r.association(:ride)]} 
  trip.hitchhikes 2
end

Factory.define :ride do |ride|
  ride.title 'Wow, what a ride'
  ride.story 'A crazy new story about hitchhiking'
{'fraction_non_alphanumeric': 0.13584183673469388, 'fraction_numerical': 0.01721938775510204, 'mean_word_length': 3.1507936507936507, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '870677', 'n_tokens_mistral': 581, 'n_tokens_neox': 546, 'n_words': 145}