<commit_before># coding: UTF-8

class APIKey < Sequel::Model(:api_keys)

  def validate
    super
    errors.add(:domain, 'has an invalid format') if !domain || domain.empty? || domain !~ /^http:\/\/[0-9a-z]+/i
  end

  def before_create
    self.api_key = User.secure_digest(self.domain)
    super
  end

  def user
    User[:id => user_id]
  end

end<commit_msg>Include http:// at the beginning of the domain<commit_after># coding: UTF-8

class APIKey < Sequel::Model(:api_keys)

  def validate
    super
    domain = "http://#{domain}" if domain !~ /^http:\/\//
  end

  def before_create
    self.api_key = User.secure_digest(self.domain)
    super
  end

  def user
    User[:id => user_id]
  end

end
{'fraction_non_alphanumeric': 0.13739376770538245, 'fraction_numerical': 0.0056657223796034, 'mean_word_length': 2.9719101123595504, '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': '7447307', 'n_tokens_mistral': 259, 'n_tokens_neox': 248, 'n_words': 65}