class ActiveRecord::InternalMetadata

def table_exists?

def table_exists?
  connection.schema_cache.data_source_exists?(table_name)
end