<commit_before># frozen_string_literal: true

class LeadershipPositionInvite < ApplicationRecord
  belongs_to :sender, class_name: 'User'
  belongs_to :new_club
  belongs_to :user

  validates :sender, :new_club, :user, presence: true
  validates :accepted_at, absence: true, if: -> { rejected_at.present? }
  validates :rejected_at, absence: true, if: -> { accepted_at.present? }

  # a user cannot have multiple invites out to join the same club
  validates :user, uniqueness: { scope: %i[new_club rejected_at] }
end<commit_msg>LeadershipPositionInvite belongs_to LeadershipPosition<commit_after># frozen_string_literal: true

class LeadershipPositionInvite < ApplicationRecord
  belongs_to :sender, class_name: 'User'
  belongs_to :new_club
  belongs_to :user
  belongs_to :leadership_position

  validates :sender, :new_club, :user, presence: true
  validates :accepted_at, absence: true, if: -> { rejected_at.present? }
  validates :rejected_at, absence: true, if: -> { accepted_at.present? }

  # a user cannot have multiple invites out to join the same club
  validates :user, uniqueness: { scope: %i[new_club rejected_at] }
end
{'fraction_non_alphanumeric': 0.09251101321585903, 'fraction_numerical': 0.0, 'mean_word_length': 5.566473988439307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '962681', 'n_tokens_mistral': 362, 'n_tokens_neox': 356, 'n_words': 107}