<commit_before>class DefinedWord < ApplicationRecord
  belongs_to :user
  has_many :votes, as: :voteable
  has_many :comments, as: :commentable

  validates :user, :word, :definition, presence: true

  before_save :downcase_fields

  def downcase_fields
    self.word.downcase
  end

  def has_comment?(comment)
    self.comments.where(id: comment.id).count > 0
  end
end
<commit_msg>REALLY Downcase any future defined words up being submitted<commit_after>class DefinedWord < ApplicationRecord
  belongs_to :user
  has_many :votes, as: :voteable
  has_many :comments, as: :commentable

  validates :user, :word, :definition, presence: true

  before_save :downcase_fields

  def downcase_fields
    self.word.downcase!
  end

  def has_comment?(comment)
    self.comments.where(id: comment.id).count > 0
  end
end

{'fraction_non_alphanumeric': 0.08466257668711656, 'fraction_numerical': 0.00245398773006135, 'mean_word_length': 4.476510067114094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4707973', 'n_tokens_mistral': 273, 'n_tokens_neox': 265, 'n_words': 72}