instance method
ensure_connection_ready
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
ensure_connection_ready(allow_retry:, materialize_transactions:)
Ensure the connection is ready to execute a query. Returns whether reconnect-and-restore is available for retry decisions.
Parameters
-
allow_retrykeyreq -
materialize_transactionskeyreq
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 1195
def ensure_connection_ready(allow_retry:, materialize_transactions:)
connect! if !connected? && reconnect_can_restore_state?
self.materialize_transactions if materialize_transactions
reconnectable = reconnect_can_restore_state?
verify! unless skip_verification?(allow_retry:, reconnectable:)
reconnectable
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 1195
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter