instance method
discard!
Ruby on Rails 6.0.6
Since v5.2.8.1Signature
discard!()
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.
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 526
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
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 526
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter