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: 164_refactor_required_fields.rb
    path of file: ./repos/archivesspace/common/db/migrations
    
    the code of the file until where you have to start completion: require_relative 'utils'
require 'json'

def convert_blob(old_blob, record_type)
  new_blob = {'lock_version' => 1}
  new_blob['record_type'] = record_type
  new_blob['subrecord_requirements'] 
    
def convert_blob(old_blob, record_type)
  new_blob = {'lock_version' => 1}
  new_blob['record_type'] = record_type
  new_blob['subrecord_requirements'] = []
  old_blob.each do |property, defn|
    next unless defn.is_a?(Array)
    sr = {'property' => property}
    defn.each do |requirement|
      requirement.each do |field, value|
        next unless value == "REQ"
        sr['required_fields'] ||= []
        sr['required_fields'] << field
      end
    end
    new_blob['subrecord_requirements'] << sr
  end
  new_blob
end