<commit_before>class Member < ActiveRecord::Base
  has_one :team_member, dependent: :destroy
  has_one :team, through: :team_member
  has_many :expert_session_attendances, as: :guest
  has_many :expert_sessions, through: :expert_session_attendances, source: :event, class_name: 'ExpertSession'
  has_one :user, as: :profile
  scope :with_no_user, -> {
    includes(:user).where(users: { id: nil })
  }

  include HasVcard

  def name
    vcard.full_name
  end

  def name=(value)
    vcard.full_name = value
  end

  mount_uploader :avatar, AvatarUploader

  include PgSearch
  # To allow searching for vcard on team as no nested
  # associated_against queries are supported yet
  has_one :team_vcard, through: :team, source: :vcard
  pg_search_scope :by_text,
    using: { tsearch: { prefix: true } },
    against: [ :description ],
    associated_against: {
      vcard: HasVcardSupport.pg_search_against,
      team_vcard: HasVcardSupport.pg_search_against
    }

  def to_s
    name
  end
end
<commit_msg>chore(expert-sessions): add dependent for Member#expert_session_attendances<commit_after>class Member < ActiveRecord::Base
  has_one :team_member, dependent: :destroy
  has_one :team, through: :team_member
  has_many :expert_session_attendances, as: :guest, dependent: :restrict_with_error
  has_many :expert_sessions, through: :expert_session_attendances, source: :event, class_name: 'ExpertSession'
  has_one :user, as: :profile
  scope :with_no_user, -> {
    includes(:user).where(users: { id: nil })
  }

  include HasVcard

  def name
    vcard.full_name
  end

  def name=(value)
    vcard.full_name = value
  end

  mount_uploader :avatar, AvatarUploader

  include PgSearch
  # To allow searching for vcard on team as no nested
  # associated_against queries are supported yet
  has_one :team_vcard, through: :team, source: :vcard
  pg_search_scope :by_text,
    using: { tsearch: { prefix: true } },
    against: [ :description ],
    associated_against: {
      vcard: HasVcardSupport.pg_search_against,
      team_vcard: HasVcardSupport.pg_search_against
    }

  def to_s
    name
  end
end

{'fraction_non_alphanumeric': 0.08802650260293422, 'fraction_numerical': 0.0, 'mean_word_length': 4.181372549019608, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1507165', 'n_tokens_mistral': 734, 'n_tokens_neox': 713, 'n_words': 180}