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: identity_cache.rb
    path of file: ./repos/tapioca/lib/tapioca/dsl/compilers
    
    the code of the file until where you have to start completion: # typed: strict
# frozen_string_literal: true

return unless defined?(ActiveRecord::Base) && defined?(IdentityCache::WithoutPrimaryIndex)

require "tapioca/dsl/helpers/active_record_column_type_helper"

module Tapioca
  module Dsl
    module Compilers
      # `Tapioca::Dsl::Compilers::IdentityCache` generates RBI files for Active Record models
      #  that use `include IdentityCache`.
      # [`IdentityCache`](https://github.com/Shopify/identity_cache) is a blob level caching solution
      # to plug into Active Record.
      #
      # For example, with the following Active Record class:
      #
      # ~~~rb
      # # post.rb
      # class Post < Appli
    
        def decorate
          caches = constant.send(:all_cached_associations)
          cache_indexes = constant.send(:cache_indexes)
          return if caches.empty? && cache_indexes.empty?

          root.create_path(constant) do |model|
            cache_manys = constant.send(:cached_has_manys)
            cache_ones = constant.send(:cached_has_ones)
            cache_belongs = constant.send(:cached_belongs_tos)

            cache_indexes.each do |field|
              create_fetch_by_methods(field, model)
            end

            cache_manys.values.each do |field|
              create_fetch_field_methods(field, model, returns_collection: true)
            end

            cache_ones.values.each do |field|
              create_fetch_field_methods(field, model, returns_collection: false)
            end

            cache_belongs.values.each do |field|
              create_fetch_field_methods(field, model, returns_collection: false)
            end
          end
        end