<commit_before>module Parrot
  class Comment < ActiveRecord::Base
    self.table_name = :parrot_comments # FIXME: Not needed if I can isolate the gem

    belongs_to :commentable, :polymorphic => true
    belongs_to :author, :class_name => Parrot.author_class

    before_save :cache_author_data

    attr_accessible :commentable, :body

    validates_presence_of :commentable, :body, :author_id

    def self.following(other_comment)
      where("created_at > '#{other_comment.created_at}'")
    end<commit_msg>Siblings and following comments logic.<commit_after>module Parrot
  class Comment < ActiveRecord::Base
    self.table_name = :parrot_comments # FIXME: Not needed if I can isolate the gem

    belongs_to :commentable, :polymorphic => true
    belongs_to :author, :class_name => Parrot.author_class

    before_save :cache_author_data

    attr_accessible :commentable, :body

    validates_presence_of :commentable, :body, :author_id

    def self.siblings_of(other_comment)
      where(
        commentable_type: other_comment.commentable_type,
        commentable_id: other_comment.commentable_id
      )
    end

    def self.following(other_comment)
      siblings_of(other_comment).where("id > #{other_comment.id}")
    end
{'fraction_non_alphanumeric': 0.08232445520581114, 'fraction_numerical': 0.0, 'mean_word_length': 4.166666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4983264', 'n_tokens_mistral': 390, 'n_tokens_neox': 379, 'n_words': 87}