<commit_before>class Pledge
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::History::Trackable
  include Mongoid::Userstamp

  # relationships
  embedded_in :pregnancy

  field :pledge_type, type: String # soft/patient/naf/other/final_dcaf
  field :amount, type: Integer
  field :other_pledge_identifier, type: String
  field :sent, type: DateTime # validate presence when type is final
  field :sent_by, type: String # validate presence when type is final
  field :paid, type: Boolean # validate presence when type is final
  field :paid_date, type: DateTime # validate presence when type is final

  validates :created_by, presence: true

  track_history on: fields.keys + [:updated_by_id],
                version_field: :version,
                track_create: true,
                track_update: true,
                track_destroy: true

  mongoid_userstamp user_model: 'User'
end
<commit_msg>Update pledge.rb<commit_after>class Pledge < Active Record ::Base
  include Auditable
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::History::Trackable
  include Mongoid::Userstamp

  # relationships
  embedded_in :pregnancy

  field :pledge_type, type: String # soft/patient/naf/other/final_dcaf
  field :amount, type: Integer
  field :other_pledge_identifier, type: String
  field :sent, type: DateTime # validate presence when type is final
  field :sent_by, type: String # validate presence when type is final
  field :paid, type: Boolean # validate presence when type is final
  field :paid_date, type: DateTime # validate presence when type is final

  validates :created_by, presence: true

end

{'fraction_non_alphanumeric': 0.07112718505123568, 'fraction_numerical': 0.0, 'mean_word_length': 4.139318885448916, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5680401', 'n_tokens_mistral': 478, 'n_tokens_neox': 460, 'n_words': 163}