<commit_before>require 'factory_girl'

Factory.define(:posting) do |posting|
  posting.association :person
  posting.association :node
  posting.sequence(:title) { |n| "title#{n}"}
  posting.sequence(:body) { |n| "body#{n}"}
  posting.is_question false
  posting.deleted_at nil
  posting.answered_at nil
end

Factory.define(:group) do |group|
  group.sequence(:name) { |n| "tag#{n}"}
end

Factory.define(:membership) do |m|
  m.association :person
  m.association :group
  m.is_administrator false
  m.status "pending"
end

Factory.define(:node) do |node|
  node.sequence(:name) { |n| "name#{n}"}
  node.association :visibility, :factory => :permission_setting
  node.association :changeability, :factory => :permission_setting
end

Factory.define(:node_version) do |node_version|
  node_version.description "This is a description"
  node_version.contents "These are contents"
end

Factory.define(:permission_setting) do |p|
  p.short_form "a"
  p.name "Everyone"
end

Factory.define(:person) do |person|
  person.sequence(:first_name) { |n| "first#{n}"}
  person.sequence(:last_name) { |n| "last#{n}"}
  person.sequence(:email_address) { |n| "email#{n}@<EMAIL>"}
  person.password "password"
  person.administrator false

  person.avatar_file_name "avatar"
  person.avatar_content_type "image/jpeg"
  person.avatar_file_size 20
end

Factory.define(:project) do |project|
  project.sequence(:name) { |n| "tag#{n}"}
end

Factory.define(:tag) do |tag|
  tag.sequence(:name) { |n| "tag#{n}"}
  tag.association :person
end

Factory.define(:tagged_node) do |tn|
  tn.association :node
  tn.association :tag
  tn.association :person
  tn.sequence(:comment) { |n| "comment#{n}"}
end
<commit_msg>Improved factories<commit_after>require 'factory_girl'

Factory.define(:posting) do |posting|
  posting.association :person
  posting.association :node
  posting.sequence(:title) { |n| "title#{n}"}
  posting.sequence(:body) { |n| "body#{n}"}
  posting.is_question false
  posting.deleted_at nil
  posting.answered_at nil
end

Factory.define(:group) do |group|
  group.sequence(:name) { |n| "tag#{n}"}
end

Factory.define(:membership) do |m|
  m.association :person
  m.association :group
  m.is_administrator false
  m.status "pending"
end

Factory.define(:node) do |node|
  node.sequence(:name) { |n| "name#{n}"}
  node.association :visibility, :factory => :permission_setting
  node.association :changeability, :factory => :permission_setting
end

Factory.define(:node_version) do |node_version|
  node_version.description "This is a description"
  node_version.contents "These are contents"
end

Factory.define(:permission_setting) do |p|
  p.short_form "a"
  p.name "Everyone"
end

Factory.define(:person) do |person|
  person.sequence(:first_name) { |n| "first#{n}"}
  person.sequence(:last_name) { |n| "last#{n}"}
  person.sequence(:email_address) { |n| "<EMAIL>"}
  person.password "password"
  person.administrator false
  person.registration_consent true

  person.avatar_file_name "avatar"
  person.avatar_content_type "image/jpeg"
  person.avatar_file_size 20
end

Factory.define(:project) do |project|
  project.sequence(:name) { |n| "tag#{n}"}
end

Factory.define(:tag) do |tag|
  tag.sequence(:name) { |n| "tag#{n}"}
  tag.association :person
end

Factory.define(:tagged_node) do |tn|
  tn.association :node
  tn.association :tag
  tn.association :person
  tn.sequence(:comment) { |n| "comment#{n}"}
end

{'fraction_non_alphanumeric': 0.1512037580739871, 'fraction_numerical': 0.0011743981209630064, 'mean_word_length': 5.344506517690875, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4909786', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1226, 'n_words': 261}