app/models/user.rb
def seen!
    now = Time.now.utc
    self.class.where(:id => id).update_all(:last_seen_at => now)
    write_attribute(:last_seen_at, now)
  end
# this is used to keep track of the last time a user has been seen (reading a topic)
# it is used to know when topics are new or old and which should have the green
# activity light next to them
#
# we cheat by not calling it all the time, but rather only when a user views a topic
# which means it isn't truly "last seen at" but it does serve it's intended purpose
#
# This is now also used to show which users are online... not at accurate as the
# session based approach, but less code and less overhead.
this is used to keep track of the last time a user has been seen (reading a topic)
it is used to know when topics are new or old and which should have the green
activity light next to them

we cheat by not calling it all the time, but rather only when a user views a topic
which means it isn't truly "last seen at" but it does serve it's intended purpose

This is now also used to show which users are online... not at accurate as the
session based approach, but less code and less overhead.
this is used to keep track of the last time a user has been seen ( reading a topic ) it is used to know when topics are new or old and which should have the green activity light next to them we cheat by not calling it all the time but rather only when a user views a topic which means it isn ' t truly " last seen at " but it does serve it ' s intended purpose This is now also used to show which users are online ... not at accurate as the session based approach but less code and less overhead .
def seen!
    now = Time.now.utc
    self.class.where(:id => id).update_all(:last_seen_at => now)
    write_attribute(:last_seen_at, now)
  end
def seen! now = Time . now . utc self . class . where ( :id => id ) . update_all ( :last_seen_at => now ) write_attribute ( :last_seen_at , now ) end
this is used to keep track of the last time a user has been seen (reading a topic)
it is used to know when topics are new or old and which should have the green
activity light next to them
this is used to keep track of the last time a user has been seen ( reading a topic ) it is used to know when topics are new or old and which should have the green activity light next to them