<commit_before>class Comment < ApplicationRecord
  belongs_to :reader
  belongs_to :comment_thread

  translates :content

  acts_as_list  scope: :comment_thread

  validates :content, presence: :true

  after_create { CommentBroadcastJob.perform_now self }
  after_create_commit { CommentThreadBroadcastJob.perform_later comment_thread }
  after_create_commit :send_notifications_of_reply

  def timestamp
    I18n.l created_at, format: :long
  end

  private
  def send_notifications_of_reply
    notification_data = {
      notifier_id: reader.id,
      comment_thread_id: comment_thread.id,
      card_id: comment_thread.card.id,
      case_id: comment_thread.card.case.id,
      page_id: comment_thread.card.element.id,
    }

    (comment_thread.collocutors - [reader]).each do |r|<commit_msg>Display comment times in Detroit time<commit_after>class Comment < ApplicationRecord
  belongs_to :reader
  belongs_to :comment_thread

  translates :content

  acts_as_list  scope: :comment_thread

  validates :content, presence: :true

  after_create { CommentBroadcastJob.perform_now self }
  after_create_commit { CommentThreadBroadcastJob.perform_later comment_thread }
  after_create_commit :send_notifications_of_reply

  def timestamp
    I18n.l created_at.in_time_zone("America/Detroit"), format: :long
  end

  private
  def send_notifications_of_reply
    notification_data = {
      notifier_id: reader.id,
      comment_thread_id: comment_thread.id,
      card_id: comment_thread.card.id,
      case_id: comment_thread.card.case.id,
      page_id: comment_thread.card.element.id,
    }

    (comment_thread.collocutors - [reader]).each do |r|
{'fraction_non_alphanumeric': 0.07134220072551391, 'fraction_numerical': 0.0024183796856106408, 'mean_word_length': 4.338709677419355, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1031644', 'n_tokens_mistral': 535, 'n_tokens_neox': 517, 'n_words': 102}