<commit_before>require 'active_record'

class Story < ActiveRecord::Base
  belongs_to :user
  has_many :votes

  def points
    votes.sum(:point)
  end
end
<commit_msg>#2.1 add validations for stories<commit_after>require 'active_record'

class Story < ActiveRecord::Base
  belongs_to :user
  has_many :votes

  validates_presence_of :user_id, :title, :url

  def points
    votes.sum(:point)
  end
end

{'fraction_non_alphanumeric': 0.08684863523573201, 'fraction_numerical': 0.004962779156327543, 'mean_word_length': 4.534246575342466, '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': '7616983', 'n_tokens_mistral': 143, 'n_tokens_neox': 143, 'n_words': 36}