<commit_before>class ConceptReplacementLMSWorker
  include Sidekiq::Worker

  def perform(original_concept_id, new_concept_id)
    ConceptResult.where(concept_id: original_concept_id).update_all(concept_id: new_concept_id)
    Concept.unscoped.find(original_concept_id).update(visible: false, replacement_id: new_concept_id)
  end

end
<commit_msg>update criterion with old concept ids in lms find and replace worker<commit_after>class ConceptReplacementLMSWorker
  include Sidekiq::Worker

  def perform(original_concept_id, new_concept_id)
    ConceptResult.where(concept_id: original_concept_id).update_all(concept_id: new_concept_id)
    Criterion.where(concept_id: original_concept_id).update_all(concept_id: new_concept_id)
    Concept.unscoped.find(original_concept_id).update(visible: false, replacement_id: new_concept_id)
  end

end

{'fraction_non_alphanumeric': 0.0711743772241993, 'fraction_numerical': 0.0, 'mean_word_length': 7.88421052631579, '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': '2142224', 'n_tokens_mistral': 294, 'n_tokens_neox': 267, 'n_words': 46}