If you want to be completely accurate you can't: you'll have a row
corresponding to a particular session, but you can't tell if that
person has since quit their browser. Or they could still have your
site open but not actually be sitting at their computer. If you
sessions table has an updated_at column you will get when their
session last changed which is probably a reasonable approximation. Why
do you care?
Imagine a chat room, where all (more or less) active users are listed.
I don't need them to log in, and I don't care if they quit the
browser, a background worker would purge inactive sessions.
I also understand that I can query the "sessions" table, I was just
wondering if there is a more abstracted way of doing this in Rails.