<commit_before># Keeps track of the history of objects (mostly patients).
# Primarily consumed by the change log partial of PatientsController#edit.
class AuditTrail
  include Mongoid::History::Tracker
  include Mongoid::Userstamp
  mongoid_userstamp user_model: 'User'

  IRRELEVANT_FIELDS = %w[user_ids updated_by].freeze

  # convenience methods for clean view display
  def date_of_change
    created_at.display_date
  end

  def changed_fields
    relevant_fields = modified.map do |key, _value|
      key unless IRRELEVANT_FIELDS.include? key
    end
    relevant_fields.compact.map(&:humanize)
  end
<commit_msg>resolve #1330 by removing pledge sent by and last edited by from changelog<commit_after># Keeps track of the history of objects (mostly patients).
# Primarily consumed by the change log partial of PatientsController#edit.
class AuditTrail
  include Mongoid::History::Tracker
  include Mongoid::Userstamp
  mongoid_userstamp user_model: 'User'

  IRRELEVANT_FIELDS = %w[user_ids updated_by pledge_sent_by_id last_edited_by_id].freeze

  # convenience methods for clean view display
  def date_of_change
    created_at.display_date
  end

  def changed_fields
    relevant_fields = modified.map do |key, _value|
      key unless IRRELEVANT_FIELDS.include? key
    end
    relevant_fields.compact.map(&:humanize)
  end

{'fraction_non_alphanumeric': 0.05917602996254682, 'fraction_numerical': 0.00299625468164794, 'mean_word_length': 4.685106382978724, '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': '3482686', 'n_tokens_mistral': 426, 'n_tokens_neox': 404, 'n_words': 124}