Flowdock
method

connected_to?

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 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.