<commit_before>class Sorting < ActiveRecord::Base
  belongs_to :account
  
  belongs_to :category
  belongs_to :section, :foreign_key => :category_id, :class_name => "Section"
  belongs_to :article
  
  after_create :mark_article_as_updated
  before_destroy :mark_article_as_updated
  
  private
  
  def mark_article_as_updated
    self.article.update_attributes(:updated_at => Time.now) if self.article
  end
  
  
end<commit_msg>Fix article relationship on sorting.<commit_after>class Sorting < ActiveRecord::Base
  belongs_to :account
  
  belongs_to :category
  belongs_to :section, :foreign_key => :category_id, :class_name => "Section"
  
  belongs_to :document
  belongs_to :article, :foreign_key => :document_id, :class_name => "Article"
  
  after_create :mark_article_as_updated
  before_destroy :mark_article_as_updated
  
  private
  
  def mark_article_as_updated
    self.article.update_attributes(:updated_at => Time.now) if self.article
  end
  
  
end
{'fraction_non_alphanumeric': 0.07946336429308566, 'fraction_numerical': 0.0, 'mean_word_length': 4.739644970414201, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6920146', 'n_tokens_mistral': 320, 'n_tokens_neox': 323, 'n_words': 65}