<commit_before><commit_msg>Added migration to ensure in-progress versions have right version numbers<commit_after>class FixInProgressVersions < ActiveRecord::Migration
  def change
    StashEngine::Identifier.find_each do |identifier|
      lsv = identifier.last_submitted_version
      next unless lsv
      lsv_stash_version = lsv.version_number
      lsv_merritt_version = lsv.merritt_version

      identifier.resources.in_progress.find_each do |resource|
        in_progress_version = resource.stash_version
        in_progress_version.version = lsv_stash_version + 1
        in_progress_version.merritt_version = lsv_merritt_version + 1
        in_progress_version.save!
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.05106382978723404, 'fraction_numerical': 0.0028368794326241137, 'mean_word_length': 3.8689655172413793, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3014176', 'n_tokens_mistral': 210, 'n_tokens_neox': 207, 'n_words': 42}