<commit_before>creator_authority =
  # HACK: This shortcut of using `fact_relation.fact` instead of `fact_relation`
  # is possible because in the current calculation these authorities are the same
  Authority.on(fact_relation.fact, for: fact_relation.created_by).to_s(1.0)

comment = comment || @comment
json.id           comment.id
json.created_at   comment.created_at
json.created_by do |json|
  json.partial! 'users/user_partial', user: comment.created_by
  json.authority creator_authority
end
json.opinion      comment.opinion
json.content      comment.content
json.fact_data do |json|
  json.partial! 'facts/fact_data_partial', fact_data: comment.fact_data
end
json.can_destroy? comment.can_destroy<commit_msg>Potential fix on returning Authority in comment json<commit_after># hack to both be able to use this as partial and show
comment ||= @comment


# FIXME: this is probably not actually a Fact object, so
# authority will always be one
fact = comment.fact_data.fact

creator_authority =
  # HACK: This shortcut of using `fact_relation.fact` instead of `fact_relation`
  # is possible because in the current calculation these authorities are the same
  Authority.on(fact, for: comment.created_by).to_s(1.0)

json.id           comment.id
json.created_at   comment.created_at
json.created_by do |json|
  json.partial! 'users/user_partial', user: comment.created_by
  json.authority creator_authority
end
json.opinion      comment.opinion
json.content      comment.content
json.fact_data do |json|
  json.partial! 'facts/fact_data_partial', fact_data: comment.fact_data
end
json.can_destroy? comment.can_destroy
{'fraction_non_alphanumeric': 0.07962962962962963, 'fraction_numerical': 0.0024691358024691358, 'mean_word_length': 4.72791519434629, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6879921', 'n_tokens_mistral': 498, 'n_tokens_neox': 485, 'n_words': 147}