<commit_before>class User < ActiveRecord::Base
  devise :database_authenticatable,
         :recoverable,
         :rememberable,
         :trackable,
         :validatable,
         :lockable
  has_many :organization_users
  has_many :organizations, through: :organization_users
  has_many :user_invitations, foreign_key: :invited_by_id
  has_many :orders, through: :organizations

  validates :name, :primary_number, :email, presence: true
  validate :phone_numbers_are_different

  include Users::Info
  include Users::OrganizationManipulator
  include Users::UserManipulator

  after_commit :send_pending_notifications

  def deleted?
    !super_admin? && organization_users.empty?
  end
<commit_msg>Users with no access can't log in<commit_after>class User < ActiveRecord::Base
  devise :database_authenticatable,
         :recoverable,
         :rememberable,
         :trackable,
         :validatable,
         :lockable
  has_many :organization_users
  has_many :organizations, through: :organization_users
  has_many :user_invitations, foreign_key: :invited_by_id
  has_many :orders, through: :organizations

  validates :name, :primary_number, :email, presence: true
  validate :phone_numbers_are_different

  include Users::Info
  include Users::OrganizationManipulator
  include Users::UserManipulator

  after_commit :send_pending_notifications

  def deleted?
    !super_admin? && organization_users.empty?
  end

  def valid_password?(password)
    super && !deleted?
  end

{'fraction_non_alphanumeric': 0.07516778523489932, 'fraction_numerical': 0.0, 'mean_word_length': 4.4021739130434785, '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': '4366324', 'n_tokens_mistral': 455, 'n_tokens_neox': 434, 'n_words': 101}