<commit_before>class GenerateUsername

  def initialize(first_name, last_name, classcode)
    @first_name = first_name
    @last_name = last_name
    @classcode = classcode
  end

  def call
    generate
  end

  private

  attr_reader :first_name, :last_name, :classcode

  def generate
    part1         = "#{first_name}.#{last_name}".downcase
    part1_pattern = "%#{part1}%"
    at_classcode  = at_classcode(classcode)
    extant        = User.where("username ILIKE ?", part1_pattern)

    if extant.any?
      final = "#{part1}#{extant.length + 1}#{at_classcode}"
    else
      final = "#{part1}#{at_classcode}"
    end
    final
  end

  def at_classcode(classcode)
    return "" if classcode.nil?
    "@#{classcode}"
  end
end<commit_msg>change ILIKE to LIKE in query<commit_after>class GenerateUsername

  def initialize(first_name, last_name, classcode)
    @first_name = first_name
    @last_name = last_name
    @classcode = classcode
  end

  def call
    generate
  end

  private

  attr_reader :first_name, :last_name, :classcode

  def generate
    part1         = "#{first_name}.#{last_name}".downcase
    part1_pattern = "%#{part1}%"
    at_classcode  = at_classcode(classcode)
    extant        = User.where("username LIKE ?", part1_pattern)

    if extant.any?
      final = "#{part1}#{extant.length + 1}#{at_classcode}"
    else
      final = "#{part1}#{at_classcode}"
    end
    final
  end

  def at_classcode(classcode)
    return "" if classcode.nil?
    "@#{classcode}"
  end
end
{'fraction_non_alphanumeric': 0.11280690112806901, 'fraction_numerical': 0.0092899800928998, 'mean_word_length': 3.097826086956522, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6340138', 'n_tokens_mistral': 534, 'n_tokens_neox': 525, 'n_words': 110}