<commit_before>class User < ActiveRecord::Base
  has_secure_password validations: false

  has_one :user_detail

  has_many :invoices, dependent: :destroy
  has_many :clients, dependent: :destroy
  has_many :projects, through: :clients
  has_many :user_options, dependent: :destroy
  has_many :authentications, dependent: :destroy

  accepts_nested_attributes_for :user_detail

  validates :password, presence: true, on: :create, unless: :skipping_password?
  validates :email, presence: true, length: { within: 6..100, if: :email_present? }, format: { with: /\A[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\z/i, if: :email_present? }

  after_create :set_auth_token<commit_msg>use a proc to determine if has_secure_password should validate or note<commit_after>class User < ActiveRecord::Base
  has_secure_password validations: proc { |user| !user.skipping_password? }

  has_one :user_detail

  has_many :invoices, dependent: :destroy
  has_many :clients, dependent: :destroy
  has_many :projects, through: :clients
  has_many :user_options, dependent: :destroy
  has_many :authentications, dependent: :destroy

  accepts_nested_attributes_for :user_detail

  validates :email, presence: true, length: { within: 6..100, if: :email_present? }, format: { with: /\A[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\z/i, if: :email_present? }

  after_create :set_auth_token
{'fraction_non_alphanumeric': 0.13876651982378854, 'fraction_numerical': 0.014684287812041116, 'mean_word_length': 5.552884615384615, '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': '4181484', 'n_tokens_mistral': 486, 'n_tokens_neox': 467, 'n_words': 111}