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: submission_template.rb
    path of file: ./repos/sequencescape/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
# It associates a name to a pre-filled submission (subclass) and a serialized set of attributes
# We could have use a Prototype Factory , and so just associate a name to existing submission
# but that doesn't work because the submission prototype doesn't
    
  def supercede
    ActiveRecord::Base.transaction do
      dup.tap do |cloned|
        yield(cloned) if block_given?
        name, cloned.name = cloned.name, "Superceding #{cloned.name}"
        cloned.save!
        update!(superceded_by_id: cloned.id, superceded_at: Time.zone.now)
        cloned.update!(name: name)
      end
    end
  end