Commit 152f6638 by tady

User.now_viewing group_by

parent e3abbf72
......@@ -176,7 +176,7 @@ GEM
gmail_xoauth (0.4.1)
oauth (>= 0.3.6)
gritter (1.1.0)
guard (2.8.1)
guard (2.8.2)
formatador (>= 0.2.4)
listen (~> 2.7)
lumberjack (~> 1.0)
......@@ -451,7 +451,7 @@ GEM
rack (>= 1.0)
webrobots (0.1.1)
websocket (1.2.1)
websocket-driver (0.3.5)
websocket-driver (0.4.0)
xpath (2.0.0)
nokogiri (~> 1.3)
......
......@@ -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) }
scope :now_viewing, -> { joins(:footprints).where('footprints.updated_at > ?', 10.minutes.ago).group('users.id') }
######################################################################
# 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