method
discard!
v7.0.0 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::AbstractAdapter
discard!()public
Immediately forget this connection ever existed. Unlike disconnect!, this will not communicate with the server.
After calling this method, the behavior of all other methods becomes undefined. This is called internally just before a forked process gets rid of a connection that belonged to its parent.
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 547
def discard!
# This should be overridden by concrete adapters.
#
# Prevent @connection's finalizer from touching the socket, or
# otherwise communicating with its server, when it is collected.
if schema_cache.connection == self
schema_cache.connection = nil
end
end Related methods
- Instance methods
- active?
- adapter_name
- advisory_locks_enabled?
- all_foreign_keys_valid?
- async_enabled?
- build_insert_sql
- case_insensitive_comparison
- case_sensitive_comparison
- check_if_write_query
- check_version
- clear_cache!
- close
- connection_class
- create_enum
- database_version
- default_index_type?
- default_uniqueness_comparison
- disable_extension
- disable_referential_integrity
- discard!
- disconnect!
- enable_extension
- expire
- extensions
- field_ordered_value
- get_advisory_lock
- get_database_version
- index_algorithms
- lease
- migration_context
- migrations_paths
- prefetch_primary_key?
- prepared_statements
- prepared_statements?
- prepared_statements_disabled_cache
- preventing_writes?
- raw_connection
- reconnect!
- release_advisory_lock
- replica?
- requires_reloading?
- reset!
- role
- schema_cache
- schema_cache=
- schema_migration
- schema_version
- seconds_idle
- shard
- steal!
- supports_advisory_locks?
- supports_bulk_alter?
- supports_check_constraints?
- supports_comments?
- supports_comments_in_create?
- supports_common_table_expressions?
- supports_concurrent_connections?
- supports_datetime_with_precision?
- supports_ddl_transactions?
- supports_deferrable_constraints?
- supports_explain?
- supports_expression_index?
- supports_extensions?
- supports_foreign_keys?
- supports_foreign_tables?
- supports_index_sort_order?
- supports_indexes_in_create?
- supports_insert_conflict_target?
- supports_insert_on_duplicate_skip?
- supports_insert_on_duplicate_update?
- supports_insert_returning?
- supports_json?
- supports_lazy_transactions?
- supports_materialized_views?
- supports_optimizer_hints?
- supports_partial_index?
- supports_partitioned_indexes?
- supports_savepoints?
- supports_transaction_isolation?
- supports_validate_constraints?
- supports_views?
- supports_virtual_columns?
- throw_away!
- unprepared_statement
- use_metadata_table?
- valid_type?
- verify!
- with_instrumenter
- Class methods
- build_read_query_regexp
- database_exists?
- new
- quoted_column_names
- quoted_table_names
- type_cast_config_to_boolean
- type_cast_config_to_integer
- Private methods
-
extract_limit -
extract_precision -
extract_scale -
initialize_type_map -
register_class_with_limit -
register_class_with_precision -
arel_visitor -
build_result -
build_statement_pool -
can_perform_case_insensitive_comparison_for? -
collector -
column_for -
column_for_attribute -
log -
transform_query -
translate_exception -
translate_exception_class -
type_map -
without_prepared_statement?