<commit_before>require_relative '../models/init.rb'

class CreateUserLevels
  def self.create_levels
    UserLevel.delete_all

    create_level('Master Helper', 5000, nil)
    user_level4 = create_level('Expert Helper', 2000, user_level4)
    user_level3 = create_level('Trusted Helper', 500, user_level4)
    user_level2 = create_level('Promising Helper', 180, user_level3)
    create_level('New Helper', 0, user_level2)

   #calculate level for each user
   Helper.find_each do |helper|
    helper.set_user_level
    helper.save!
   end
  end

  def self.create_level(name, point_threshold, next_user_level)
    user_level = UserLevel.new
    user_level.point_threshold = point_threshold
    user_level.name = name
    user_level.next_user_level = next_user_level unless next_user_level.nil?
    user_level.save!
    user_level
  end
end<commit_msg>adjust points so you can go up one level if you only have twitter or facebook<commit_after>require_relative '../models/init.rb'

class CreateUserLevels
  def self.create_levels
    UserLevel.delete_all

    create_level('Master Helper', 5000, nil)
    user_level4 = create_level('Expert Helper', 2000, user_level4)
    user_level3 = create_level('Trusted Helper', 500, user_level4)
    user_level2 = create_level('Promising Helper', 150, user_level3)
    create_level('New Helper', 0, user_level2)

   #calculate level for each user
   Helper.find_each do |helper|
    helper.set_user_level
    helper.save!
   end
  end

  def self.create_level(name, point_threshold, next_user_level)
    user_level = UserLevel.new
    user_level.point_threshold = point_threshold
    user_level.name = name
    user_level.next_user_level = next_user_level unless next_user_level.nil?
    user_level.save!
    user_level
  end
end
{'fraction_non_alphanumeric': 0.07814269535673839, 'fraction_numerical': 0.02491506228765572, 'mean_word_length': 4.258928571428571, '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': '4521191', 'n_tokens_mistral': 618, 'n_tokens_neox': 573, 'n_words': 134}