<commit_before>class Answer < ActiveRecord::Base
  belongs_to :question
  belongs_to :user
  has_many :comments, as: :commentable
  has_many :votes, as: :votable

  validates_presence_of :content, :question_id, :user_id

  def score
  	count = 0
  	self.votes.each do |vote|
  	 count = count + vote.status
  	end
  	count
  end
end
<commit_msg>Add score_tally method to Answer model<commit_after>class Answer < ActiveRecord::Base
  belongs_to :question
  belongs_to :user
  has_many :comments, as: :commentable
  has_many :votes, as: :votable

  validates_presence_of :content, :question_id, :user_id

  def score_tally
  	count = 0
  	self.votes.each do |vote|
  	 count = count + vote.status
  	end
  	self.score = count
    self.save
  end
end

{'fraction_non_alphanumeric': 0.08155080213903744, 'fraction_numerical': 0.00267379679144385, 'mean_word_length': 3.710691823899371, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2929853', 'n_tokens_mistral': 277, 'n_tokens_neox': 274, 'n_words': 73}