<commit_before>class Author < ActiveRecord::Base
  has_many :posts
  has_one :post
  has_many :very_special_comments, :through => :posts
  has_many :posts_with_comments, -> { includes(:comments) }, :class_name => "Post"
  has_many :popular_grouped_posts, -> { includes(:comments).group("type").having("SUM(comments_count) > 1").select("type") }, :class_name => "Post"
  has_many :posts_with_comments_sorted_by_comment_id, -> { includes(:comments).order('comments.id') }, :class_name => "Post"
  has_many :posts_sorted_by_id_limited, -> { order('posts.id').limit(1) }, :class_name => "Post"
  has_many :posts_with_categories, -> { includes(:categories) }, :class_name => "Post"
  has_many :posts_with_comments_and_categories, -> { includes(:comments, :categories).order("posts.id") }, :class_name => "Post"
  has_many :posts_containing_the_letter_a, :class_name => "Post"
  has_many :posts_with_special_categorizations, :class_name => 'PostWithSpecialCategorization'
  has_many :posts_with_extension, :class_name => "Post"
  has_one  :post_about_thinking, -> { where("posts.title like '%thinking%'") }, :class_name => 'Post'
  has_one  :post_about_thinking_with_last_comment, -> { where("posts.title like '%thinking%'").includes(:last_comment) }, :class_name => 'Post'
  has_many :comments, through: :posts do
    def ratings
      Rating.joins(:comment).merge(self)
    end
  end
  has_many :comments_containing_the_letter_e, :through => :posts, :source => :comments
  has_many :comments_with_order_and_conditions, -> { order('comments.body').where("comments.body like 'Thank%'") }, :through => :posts, :source => :comments
  has_many :comments_with_include, -> { includes(:post) }, :through => :posts, :source => :comments

  has_many :first_posts
  has_many :comments_on_first_posts, -> { order('posts.id desc, comments.id asc') }, :through => :first_posts, :source => :comments

  has_one :first_post
  has_one :comment_on_first_post, -> { order('posts.id desc, comments.id asc') }, :through => :first_post, :source => :comments

  has_many :thinking_posts, -> { where(:title => 'So I was thinking') }, :dependent => :delete_all, :class_name => 'Post'
  has_many :welcome_posts, -> { where(:title => 'Welcome to the weblog') }, :class_name => 'Post'

  has_many :comments_desc, -> { order('comments.id DESC') }, :through => :posts, :source => :comments
  has_many :limited_comments, -> { limit(1) }, :through => :posts, :source => :comments
  has_many :funky_comments, :through => :posts, :source => :comments
  has_many :ordered_uniq_comments, -> { distinct.order('comments.id') }, :through => :posts, :source => :comments
  has_many :ordered_uniq_comments_desc, -> { distinct.order('comments.id DESC') }, :through => :posts, :source => :comments
  has_many :readonly_comments, -> { readonly }, :through => :posts, :source => :comments

  has_many :special_posts<commit_msg>Clean up unused associations in AR test model<commit_after>class Author < ActiveRecord::Base
  has_many :posts
  has_one :post
  has_many :very_special_comments, :through => :posts
  has_many :posts_with_comments, -> { includes(:comments) }, :class_name => "Post"
  has_many :popular_grouped_posts, -> { includes(:comments).group("type").having("SUM(comments_count) > 1").select("type") }, :class_name => "Post"
  has_many :posts_with_comments_sorted_by_comment_id, -> { includes(:comments).order('comments.id') }, :class_name => "Post"
  has_many :posts_sorted_by_id_limited, -> { order('posts.id').limit(1) }, :class_name => "Post"
  has_many :posts_with_categories, -> { includes(:categories) }, :class_name => "Post"
  has_many :posts_with_comments_and_categories, -> { includes(:comments, :categories).order("posts.id") }, :class_name => "Post"
  has_many :posts_with_special_categorizations, :class_name => 'PostWithSpecialCategorization'
  has_one  :post_about_thinking, -> { where("posts.title like '%thinking%'") }, :class_name => 'Post'
  has_one  :post_about_thinking_with_last_comment, -> { where("posts.title like '%thinking%'").includes(:last_comment) }, :class_name => 'Post'
  has_many :comments, through: :posts do
    def ratings
      Rating.joins(:comment).merge(self)
    end
  end
  has_many :comments_containing_the_letter_e, :through => :posts, :source => :comments
  has_many :comments_with_order_and_conditions, -> { order('comments.body').where("comments.body like 'Thank%'") }, :through => :posts, :source => :comments
  has_many :comments_with_include, -> { includes(:post) }, :through => :posts, :source => :comments

  has_many :first_posts
  has_many :comments_on_first_posts, -> { order('posts.id desc, comments.id asc') }, :through => :first_posts, :source => :comments

  has_one :first_post
  has_one :comment_on_first_post, -> { order('posts.id desc, comments.id asc') }, :through => :first_post, :source => :comments

  has_many :thinking_posts, -> { where(:title => 'So I was thinking') }, :dependent => :delete_all, :class_name => 'Post'
  has_many :welcome_posts, -> { where(:title => 'Welcome to the weblog') }, :class_name => 'Post'

  has_many :comments_desc, -> { order('comments.id DESC') }, :through => :posts, :source => :comments
  has_many :funky_comments, :through => :posts, :source => :comments
  has_many :ordered_uniq_comments, -> { distinct.order('comments.id') }, :through => :posts, :source => :comments
  has_many :ordered_uniq_comments_desc, -> { distinct.order('comments.id DESC') }, :through => :posts, :source => :comments
  has_many :readonly_comments, -> { readonly }, :through => :posts, :source => :comments

  has_many :special_posts
{'fraction_non_alphanumeric': 0.1666965405986736, 'fraction_numerical': 0.0008962179602079225, 'mean_word_length': 5.863468634686347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 116, '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': '4918688', 'n_tokens_mistral': 1823, 'n_tokens_neox': 1791, 'n_words': 371}