instance method discard!

Ruby on Rails 7.0.10

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

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 539
      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 539 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter

Type at least 2 characters to search.

↑↓ navigate · open · esc close