<commit_before>class Student < ActiveRecord::Base

  belongs_to :drug
  belongs_to :race
  belongs_to :school
  belongs_to :risk_factor
  belongs_to :updated_school, :class_name => "School", :foreign_key => "updated_school_id"
  belongs_to :deputy, :class_name => "User", :foreign_key => "school_deputy_id"

  has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "100x100>" }

end<commit_msg>Added method for age<commit_after>class Student < ActiveRecord::Base

  belongs_to :drug
  belongs_to :race
  belongs_to :school
  belongs_to :risk_factor
  belongs_to :updated_school, :class_name => "School", :foreign_key => "updated_school_id"
  belongs_to :deputy, :class_name => "User", :foreign_key => "school_deputy_id"

  has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "100x100>" }

  def age(dob, now = Time.now.utc.to_date)
    now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
  end

end
{'fraction_non_alphanumeric': 0.14762386248736098, 'fraction_numerical': 0.0262891809908999, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '4293434', 'n_tokens_mistral': 392, 'n_tokens_neox': 364, 'n_words': 79}