Commit 164dd6e1 by tady

fix User.now_viewing

parent 28f198f7
......@@ -56,7 +56,7 @@ class User < ActiveRecord::Base
scope :post_today, -> { joins(:posts).where('posts.updated_at > ?', 1.day.ago) }
scope :now_viewing, -> { joins(:footprints).where('footprints.updated_at > ?', 10.minutes.ago).group('users.id') }
scope :now_viewing, -> { select(:id).joins(:footprints).where('footprints.updated_at > ?', 10.minutes.ago).uniq }
######################################################################
# Validations
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment