<commit_before>class DigestHistory < ActiveRecord::Base

  def self.create_new!(frequency)
    history = new(frequency: frequency)
    history.last_discussion_id = Discussion.last.id  rescue 0
    history.last_tutorial_id = Tutorial.last.id  rescue 0
    history.last_library_id = Library.last.id rescue 0
    history.users_count = User.count
    history.save!
    history
  end

  def discussions
    Discussion.where('id > ?', last_discussion_id)
  end

  def tutorials
    Tutorial.where('id > ?', last_discussion_id)
  end

  def libraries
    Tutorial.where('id > ?', last_discussion_id)
  end

end<commit_msg>Fix some copy/paste errors<commit_after>class DigestHistory < ActiveRecord::Base

  def self.create_new!(frequency)
    history = new(frequency: frequency)
    history.last_discussion_id = Discussion.last.id  rescue 0
    history.last_tutorial_id = Tutorial.last.id  rescue 0
    history.last_library_id = Library.last.id rescue 0
    history.users_count = User.count
    history.save!
    history
  end

  def discussions
    Discussion.where('id > ?', last_discussion_id)
  end

  def tutorials
    Tutorial.where('id > ?', last_tutorial_id)
  end

  def libraries
    Library.where('id > ?', last_library_id)
  end

end
{'fraction_non_alphanumeric': 0.08973322554567502, 'fraction_numerical': 0.004850444624090542, 'mean_word_length': 3.636704119850187, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4093685', 'n_tokens_mistral': 416, 'n_tokens_neox': 389, 'n_words': 84}