<commit_before>class ProductBase < ActiveRecord::Base
  self.table_name = 'products'
  before_save :add_selector

  def add_selector
    quan = quantity.split('|')
    new_quan = quan.map do |q|
      q = q.to_i
      if q >= 1 && q <= 3
        rand(10..15)
      elsif q >= 4 && q <= 6
        rand(15..20)
      elsif q >= 7 && q < 10
        rand(20..25)
      elsif q >= 10 && q < 30
        rand(2..5)
      elsif q >= 30 && q < 40
        rand(4..10)
      else
        q
      end
    end
    self.quantity = new_quan.join('|')
  end

end<commit_msg>fix selector<commit_after>class ProductBase < ActiveRecord::Base
  self.table_name = 'products'
  before_create :add_selector

  def add_selector
    quan = quantity.split('|')
    new_quan = quan.map do |q|
      q = q.to_i
      if q >= 1 && q <= 3
        rand(10..15)
      elsif q >= 4 && q <= 6
        rand(15..20)
      elsif q >= 7 && q < 10
        rand(20..25)
      elsif q >= 10 && q < 30
        rand(2..5)
      elsif q >= 30 && q < 40
        rand(4..10)
      else
        q
      end
    end
    self.quantity = new_quan.join('|') if self.link_href.include?('6pm.com')
  end

end
{'fraction_non_alphanumeric': 0.14372294372294372, 'fraction_numerical': 0.05627705627705628, 'mean_word_length': 1.6697459584295613, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, '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': '3573413', 'n_tokens_mistral': 473, 'n_tokens_neox': 424, 'n_words': 112}