<commit_before>class Topic < ActiveRecord::Base
  stampable
  acts_as_taggable
  acts_as_votable
  has_paper_trail
  acts_as_nested_set parent_column: 'parent_topic_id', counter_cache: :children_count
  include EventMessage

  extend FriendlyId
  friendly_id :name, :use => :slugged

  has_many   :sub_topics, -> { order 'position, id' }, :class_name=>'Topic', :foreign_key => 'parent_topic_id', :inverse_of=>:parent_topic
  belongs_to :parent_topic, :class_name=>'Topic', :foreign_key => 'parent_topic_id', :inverse_of=>:sub_topics<commit_msg>Bust the parent reference cache on create<commit_after>class Topic < ActiveRecord::Base
  stampable
  acts_as_taggable
  acts_as_votable
  has_paper_trail
  acts_as_nested_set parent_column: 'parent_topic_id', counter_cache: :children_count
  include EventMessage

  extend FriendlyId
  friendly_id :name, :use => :slugged

  has_many   :sub_topics, -> { order 'position, id' }, :class_name=>'Topic', :foreign_key => 'parent_topic_id', :inverse_of=>:parent_topic
  belongs_to :parent_topic, :class_name=>'Topic', :foreign_key => 'parent_topic_id', :inverse_of=>:sub_topics, touch: true
{'fraction_non_alphanumeric': 0.11160318866253321, 'fraction_numerical': 0.0, 'mean_word_length': 7.01418439716312, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '6157487', 'n_tokens_mistral': 402, 'n_tokens_neox': 395, 'n_words': 77}