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: record.rb
    path of file: ./repos/yacs/malg
    
    the code of the file until where you have to start completion: class RecordFactory
  def initialize schema
    @schema = schem
    
  def generate_class type, props
    Class.new(Ohm::Model) do 
      props['attributes'].each { |attr| attribute attr }
      parent = props['parent_type']
      reference parent, @schema.singularize(parent).capitalize if parent
    end
  end