method

connected_to?

Importance_1
v7.0.0 - Show latest stable - 0 notes - Class: ConnectionHandling
connected_to?(role:, shard: ActiveRecord::Base.default_shard) public

Returns true if role is the current connected role.

ActiveRecord::Base.connected_to(role: :writing) do
  ActiveRecord::Base.connected_to?(role: :writing) #=> true
  ActiveRecord::Base.connected_to?(role: :reading) #=> false
end
Show source
Register or log in to add new notes.