I would like to list the current number of visitors on my site. To do this I''m counting the number of sessions that have been updated in the last five minutes. Here''s what I''m doing to make it work, please let me know if there''s a better way: First I''ve created a Session model so that I can say Session.find class Session < ActiveRecord::Base end Next in my controller I''m searching for all sessions that have been updated in the last 5 minutes like this: def dashboard @active_users = Session.find(:all, :conditions => ["updated_at > ?", Time.now - 5.minutes]).size end This all seems to work fine, I''m just wondering if it''s somehow a bad idea to create the Session model, maybe it make''s active record work harder since it may now need to associate a model with each session it''s working with? Thanks for any recommendations. Jesse -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---