<commit_before>class Apprenticeship < ActiveRecord::Base

  belongs_to :master, class_name: "User"
  belongs_to :apprentice, class_name: "User"
  has_many :ratings

  validate :duplicate_relationship?, on: :create
  validate :same_roles?
  validate :end_before_start?
<commit_msg>ADDED involve_user filter method to apprenticeship<commit_after>class Apprenticeship < ActiveRecord::Base

  belongs_to :master, class_name: "User"
  belongs_to :apprentice, class_name: "User"
  has_many :ratings

  validate :duplicate_relationship?, on: :create
  validate :same_roles?
  validate :end_before_start?

  def self.involve_user(user)
    where(["master_id = ? or apprentice_id = ?", user.id, user.id])
  end

{'fraction_non_alphanumeric': 0.09829059829059829, 'fraction_numerical': 0.0, 'mean_word_length': 5.892156862745098, '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': '3488483', 'n_tokens_mistral': 244, 'n_tokens_neox': 237, 'n_words': 55}