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: fake.rb
    path of file: ./repos/form_core/test/dummy/app/models/concerns/forms
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Forms
  module Fake
    extend ActiveSupport::Concern

    def build_random_fields(type_key_seq:)
      transaction(requires_new: true) do
        type_key_seq.each do |type_key|
          if type_key.is_a? Hash
            type_key.each do |k, v|
              klass = Fields::MAP[k]
              raise ArgumentError, "Only nested form types can be key" unless k.attached_nested_form?

              field = fields.build type: Fields::MAP[type_key].to_s,
                                   section: sections.first,
                                   accessibility: "read_and_write"
              field.label = "#{klass.model_name.name.demodulize.titleize} #{field.name.to_s.split('_').last}"
              field.save!
              klass.configure_fake_options_to field
              field.save!
              field.nested_form.build_random_fields(v)
              field.save!
            end
          else
            klass = Fields::MAP[type_key]
            raise ArgumentError, "Can't reflect field class by #{type_key}" unless klass

            field = fields.build type: Fields::MAP[type_key].to_s,
                                 section: sections.first,
                                 accessibility: "read_and_write"
            field.label = "#{klass.model_name.name.demodulize.titleize} #{field.name.to_s
    
    def build_random_fields(type_key_seq:)
      transaction(requires_new: true) do
        type_key_seq.each do |type_key|
          if type_key.is_a? Hash
            type_key.each do |k, v|
              klass = Fields::MAP[k]
              raise ArgumentError, "Only nested form types can be key" unless k.attached_nested_form?

              field = fields.build type: Fields::MAP[type_key].to_s,
                                   section: sections.first,
                                   accessibility: "read_and_write"
              field.label = "#{klass.model_name.name.demodulize.titleize} #{field.name.to_s.split('_').last}"
              field.save!
              klass.configure_fake_options_to field
              field.save!
              field.nested_form.build_random_fields(v)
              field.save!
            end
          else
            klass = Fields::MAP[type_key]
            raise ArgumentError, "Can't reflect field class by #{type_key}" unless klass

            field = fields.build type: Fields::MAP[type_key].to_s,
                                 section: sections.first,
                                 accessibility: "read_and_write"
            field.label = "#{klass.model_name.name.demodulize.titleize} #{field.name.to_s.split('_').last}"
            field.save!
            klass.configure_fake_options_to field
            field.save!
          end
        end
      end