<commit_before># frozen_string_literal: true

namespace :courses_wikis do
  desc 'Creates CoursesWikis association for existing courses through revisions'
  task migrate: :environment do
    Rails.logger.debug 'Creating CoursesWikis associations'
    Course.all.each do |course|
      course.wikis.push(Wiki.find(course.wiki_ids))
    end
  end
end<commit_msg>Make the rake task idempotent<commit_after># frozen_string_literal: true

namespace :courses_wikis do
  desc 'Creates CoursesWikis association for existing courses through revisions'
  task migrate: :environment do
    Rails.logger.debug 'Creating CoursesWikis associations'
    Course.all.each do |course|
      course.update(wikis: Wiki.find(course.wiki_ids))
    end
  end
end
{'fraction_non_alphanumeric': 0.07036535859269283, 'fraction_numerical': 0.0, 'mean_word_length': 4.736434108527132, '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': '2617877', 'n_tokens_mistral': 233, 'n_tokens_neox': 222, 'n_words': 64}