instance method
append_to_connected_to_stack
Ruby on Rails edge
Since v7.0.10 Private — implementation detail, not part of the public APISignature
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
-
entryreq
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