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: relation_extension.rb
    path of file: ./repos/activerecord-multi-tenant/lib/activerecord-multi-tenant
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Arel
  module ActiveRecordRelationExtension
    # Overrides the delete_all method to include tenant scoping
    def delete_all
      # Call the original delete_all method if the current tenant is i
    
    def generate_in_condition_subquery
      # Get the tenant key and tenant ID based on the current tenant
      tenant_key = MultiTenant.partition_key(MultiTenant.current_tenant_class)
      tenant_id = MultiTenant.current_tenant_id

      # Build an Arel query
      arel = eager_loading? ? apply_join_dependency.arel : build_arel
      arel.source.left = table

      # If the tenant ID is present and the tenant key is a column in the model,
      # add a condition to only include records where the tenant key equals the tenant ID
      if tenant_id && klass.column_names.include?(tenant_key)
        tenant_condition = table[tenant_key].eq(tenant_id)
        unless arel.constraints.any? { |node| node.to_sql.include?(tenant_condition.to_sql) }
          arel = arel.where(tenant_condition)
        end