<commit_before>module Forums
  class Topic < ApplicationRecord
    belongs_to :parent_topic, class_name: 'Topic', optional: true
    belongs_to :created_by,   class_name: 'User'

    has_many :child_topics, class_name: 'Topic', through: :parent_topic
    has_many :threads

    validates :name, presence: true, length: { in: 1..128 }
  end
end
<commit_msg>Fixed/added missing associations on Forums::Topic<commit_after>module Forums
  class Topic < ApplicationRecord
    has_ancestors   :parent_topics, key: :parent_topic_id
    belongs_to :parent_topic, class_name: 'Topic', optional: true
    belongs_to :created_by,   class_name: 'User'

    has_many :child_topics, class_name: 'Topic', foreign_key: :parent_topic_id
    has_many :threads

    validates :name, presence: true, length: { in: 1..128 }
  end
end

{'fraction_non_alphanumeric': 0.09471094710947109, 'fraction_numerical': 0.00984009840098401, 'mean_word_length': 4.575342465753424, 'pattern_counts': {'":': 0, '<': 5, '<?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': '892546', 'n_tokens_mistral': 274, 'n_tokens_neox': 267, 'n_words': 72}