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: cache_query.rb
    path of file: ./repos/torque-postgresql/spec/mocks
    
    the code of the file until where you have to start completion: module Mocks
  module CacheQuery
    def
    
    def get_last_executed_query(&block)
      conn = ActiveRecord::Base.connection
      conn.instance_variable_set(:@query_cache_enabled, true)

      block.call
      result = conn.query_cache.keys.first

      conn.instance_variable_set(:@query_cache_enabled, false)
      conn.instance_variable_get(:@query_cache).delete(result)

      result
    end