You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 20210305070001_remove_class_from_sirtrevor_image_blocks.rb
    path of file: ./repos/spotlight/db/migrate
    
    the code of the file until where you have to start completion: # frozen_
    
  def up
    Spotlight::Page.reset_column_information
    image = SirTrevorRails::Block.block_class('image')

    Spotlight::Page.find_each do |page|
      next unless page.content.any? { |block| block.is_a? image }
      page.content.select { |block| block.is_a?(image) && block.respond_to?(:class=) }.each do |block|
        block.delete_field(:class)
        block.attachment = Spotlight::Attachment.find(block.id).to_global_id rescue nil
      end

      page.update(content: page.content)
    end
  end