<commit_before>class ModifyFeedbacksToBePolymorphic < ActiveRecord::Migration[5.1]
  def up
    add_reference :feedbacks, :feedbackable, polymorphic: true, index: true
    Feedback.with_deleted.each do |feedback|
      feedback.update(feedbackable: feedback.assignment)
    end
    remove_belongs_to :feedbacks, :assignment
  end

  def down
    add_reference :feedbacks, :assignments, foreign_key: true
    Feedback.with_deleted.where(feedbackable_type: 'Assignment').each do |feedback|
      feedback.update(assignment_id: feedback.feedbackable_id)
    end
    remove_belongs_to :feedbacks, :feedbackable
  end
end<commit_msg>fix problem that occured from review change request fullfille<commit_after>class ModifyFeedbacksToBePolymorphic < ActiveRecord::Migration[5.1]
  def up
    add_reference :feedbacks, :feedbackable, polymorphic: true, index: true
    Feedback.with_deleted.each do |feedback|
      feedback.update(feedbackable_id: feedback.assignment.id, feedbackable_type: 'Assignment')
    end
    remove_belongs_to :feedbacks, :assignment
  end

  def down
    add_reference :feedbacks, :assignments, foreign_key: true
    Feedback.with_deleted.where(feedbackable_type: 'Assignment').each do |feedback|
      feedback.update(assignment_id: feedback.feedbackable_id)
    end
    remove_belongs_to :feedbacks, :feedbackable
  end
end
{'fraction_non_alphanumeric': 0.07967237527922562, 'fraction_numerical': 0.0029784065524944155, 'mean_word_length': 5.109090909090909, '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': '14738', 'n_tokens_mistral': 428, 'n_tokens_neox': 408, 'n_words': 91}