class ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
def self.call(request)
from the replica or the request needs to be sent to the primary.
The last_write is used to determine whether it's safe to read
timestamps of the last write in the session.
The session class is used by the DatabaseSelector::Resolver to save
def self.call(request) new(request.session) end