<commit_before># == Schema Information
#
# Table name: notices
#
#  id           :integer          not null, primary key
#  title        :string(255)      not null
#  body         :text
#  user_id      :integer          not null
#  published_at :datetime
#  status       :integer          default(0)
#  created_at   :datetime
#  updated_at   :datetime
#
# Indexes
#
#  index_notices_on_published_at  (published_at)
#  index_notices_on_user_id       (user_id)
#

FactoryGirl.define do
  factory :notice do
    title { "title" + ('a'..'z').to_a.sample(26).join }
    body { "body" + ('a'..'z').to_a.sample(26).join }
    user
    published_at { (rand(10) + 1).days.ago }
    status 1

    trait :draft do
      published_at nil
    end

    trait :with_tags do
      ignore do
        tags_count { rand(3) + 1 }
      end

      after(:create) do |notice, evaluator|
        create_list(:tag, evaluator.tags_count, notices: [notice])
      end
    end
  end
end<commit_msg>Fix deplication warning at notice factory<commit_after># == Schema Information
#
# Table name: notices
#
#  id           :integer          not null, primary key
#  title        :string(255)      not null
#  body         :text
#  user_id      :integer          not null
#  published_at :datetime
#  status       :integer          default(0)
#  created_at   :datetime
#  updated_at   :datetime
#
# Indexes
#
#  index_notices_on_published_at  (published_at)
#  index_notices_on_user_id       (user_id)
#

FactoryGirl.define do
  factory :notice do
    title { "title" + ('a'..'z').to_a.sample(26).join }
    body { "body" + ('a'..'z').to_a.sample(26).join }
    user
    published_at { (rand(10) + 1).days.ago }
    status 1

    trait :draft do
      published_at nil
    end

    trait :with_tags do
      after(:create) do |notice, evaluator|
        create_list(:tag, 3, notices: [notice])
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11328745367919534, 'fraction_numerical': 0.014293276866066702, 'mean_word_length': 2.2642487046632125, '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': '4861020', 'n_tokens_mistral': 665, 'n_tokens_neox': 641, 'n_words': 158}