<commit_before>class Member < ActiveRecord::Base
  validates :first_name, presence: true
  validates :last_name, presence: true
  
  belongs_to :user
  has_many :affiliations
  has_many :organizations, through: :affiliations
  
  def self.search(query)
    if query.present?
      condition = 'first_name LIKE :search OR last_name LIKE :search'
      query.split(' ').inject(self) do |conditions, term|
        conditions.where([condition, search: "#{term}%"])
      end
    else
      none
    end
  end
  
  def self.shirt_sizes
    %w{ S M L XL 2XL 3XL }
  end
  
  def self.identities
    %w{ 
      Student 
      Parent 
      Educator 
      Resident 
      Community\ Partner 
    }
  end
  
  def name
    [first_name, last_name].compact.join(' ')
  end
  
  def text
    name<commit_msg>Changed member autocomplete to always return some members<commit_after>class Member < ActiveRecord::Base
  validates :first_name, presence: true
  validates :last_name, presence: true
  
  belongs_to :user
  has_many :affiliations
  has_many :organizations, through: :affiliations
  
  def self.search(query)
    if query.present?
      condition = 'first_name LIKE :search OR last_name LIKE :search'
      query.split(' ').inject(self) do |conditions, term|
        conditions.where([condition, search: "#{term}%"])
      end
    else
      all
    end
  end
  
  def self.shirt_sizes
    %w{ S M L XL 2XL 3XL }
  end
  
  def self.identities
    %w{ 
      Student 
      Parent 
      Educator 
      Resident 
      Community\ Partner 
    }
  end
  
  def name
    [first_name, last_name].compact.join(' ')
  end
  
  def text
    name
{'fraction_non_alphanumeric': 0.0855222968845449, 'fraction_numerical': 0.002443494196701283, 'mean_word_length': 2.4703389830508473, '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': '1637161', 'n_tokens_mistral': 556, 'n_tokens_neox': 526, 'n_words': 150}