<commit_before>namespace :proposals do
  desc "Updates all proposals by recalculating their hot_score"
  task touch: :environment do
    Proposal.find_in_batches do |proposals|
      proposals.each(&:save)
    end
  end

end<commit_msg>adds rake task to make title and questions that are too short valid<commit_after>namespace :proposals do

  desc "Updates all proposals by recalculating their hot_score"
  task touch: :environment do
    Proposal.find_in_batches do |proposals|
      proposals.each(&:save)
    end
  end

  desc "Add spaces to proposal titles and questions that are too short"
  task padding: :environment do
    Proposal.find_in_batches do |proposals|

      proposals.each do |proposal|
        title = proposal.title
        if title.size < 4
          proposal.update_attribute(:title, title.ljust(4))
        end

        question = proposal.question
        if question.size < 10
          proposal.update_attribute(:question, question.ljust(10))
        end
      end

    end
  end

end
{'fraction_non_alphanumeric': 0.06515301085883514, 'fraction_numerical': 0.005923000987166831, 'mean_word_length': 2.976470588235294, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3273930', 'n_tokens_mistral': 304, 'n_tokens_neox': 298, 'n_words': 96}