class ModifyLanguageForHacks < ActiveRecord::Migration[5.2]
  def change
    HackCode.find_each do |h|
      h.update_column(:language, h.language&.gsub("cpp", "C++"))
    end

    HackUserLastestCode.find_each do |h|
      h.update_column(:language, h.language&.gsub("cpp", "C++"))
    end

    HackUserCode.find_each do |h|
      h.update_column(:language, h.language&.gsub("cpp", "C++"))
    end

    HackUserCode.find_each do |h|
      h.update_column(:language, h.language&.gsub("cpp", "C++"))
    end

  end
end
