|
|
|
@ -212,9 +212,13 @@ class UsersController < ApplicationController
|
|
|
|
|
# @activity_pages = Paginator.new @activity_count, @limit, params['page']
|
|
|
|
|
# @offset ||= @activity_pages.offset
|
|
|
|
|
# @events_by_day_ = @events.slice(@offset,@limit)
|
|
|
|
|
watcher = User.watched_by(@user)
|
|
|
|
|
watcher.push(User.current)
|
|
|
|
|
activity = Activity.where('user_id in (?)', watcher).order('id desc')
|
|
|
|
|
if @user == User.current
|
|
|
|
|
watcher = User.watched_by(@user)
|
|
|
|
|
watcher.push(User.current)
|
|
|
|
|
activity = Activity.where('user_id in (?)', watcher).order('id desc')
|
|
|
|
|
else
|
|
|
|
|
activity = Activity.where('user_id = ?', @user.id).order('id desc')
|
|
|
|
|
end
|
|
|
|
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
|
|
|
|
@activity_count = activity.count
|
|
|
|
|
@activity_pages = Paginator.new @activity_count, @limit, params['page']
|
|
|
|
|