instance method append_to_connected_to_stack

Ruby on Rails edge

Since v7.0.10 Private — implementation detail, not part of the public API

Available in: v7.0.10 v7.1.6 v7.2.4 v8.0.5.1 v8.1.4 edge

Signature

append_to_connected_to_stack(entry)

The stack can be shared with another thread or fiber through ActiveSupport::IsolatedExecutionState.share_with (ActionController::Live does this for the streaming thread), so it is never modified in place. A modified copy replaces it instead, leaving the stack seen by the other execution context untouched.

Parameters

entry req
Source
# File activerecord/lib/active_record/connection_handling.rb, line 463
      def append_to_connected_to_stack(entry)
        if entry[:shard].present? && entry[:klasses].any?(&:shard_swapping_prohibited?)
          raise ShardSwapProhibitedError, "cannot swap `shard` while shard swapping is prohibited."
        end

        stack = connected_to_stack.dup
        stack << entry
        ActiveSupport::IsolatedExecutionState[:active_record_connected_to_stack] = stack
      end

Defined in activerecord/lib/active_record/connection_handling.rb line 463 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionHandling

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close