<commit_before>class User < ActiveRecord::Base

  has_many :groupings
  has_many :groups, through: :groupings#, foreign_key: :user_id
  has_many :created_groups, class_name: "Group", foreign_key: :admin_id

  validates :first_name, presence: true
  validates :last_name, presence: true
  validates :email, format: { with: /@/, message: "Sorry, that is not a valid email address"}
  validates :phone, presence: true


  has_secure_password
<commit_msg>include full_name virtual attributes in user model<commit_after>class User < ActiveRecord::Base

  has_many :groupings
  has_many :groups, through: :groupings#, foreign_key: :user_id
  has_many :created_groups, class_name: "Group", foreign_key: :admin_id

  validates :first_name, presence: true
  validates :last_name, presence: true
  validates :email, format: { with: /@/, message: "Sorry, that is not a valid email address"}
  validates :phone, presence: true


  has_secure_password

  def full_name
    [first_name, last_name].join(' ')
  end

  def full_name=(name)
    split = name.split(' ', 2)
    self.first_name = split.first
    self.last_name = split.last
  end


{'fraction_non_alphanumeric': 0.10283687943262411, 'fraction_numerical': 0.0008865248226950354, 'mean_word_length': 4.760204081632653, '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': '2083815', 'n_tokens_mistral': 371, 'n_tokens_neox': 356, 'n_words': 107}