Show events from all projects on user page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-06-03 18:09:51 +03:00
parent b6f3f62667
commit 7984e5b1ef
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
1 changed files with 2 additions and 1 deletions

View File

@ -11,7 +11,8 @@ class UsersController < ApplicationController
end
@groups = @user.groups.accessible_to(current_user)
@events = @user.recent_events.where(project_id: @projects.pluck(:id)).limit(20)
accessible_projects = @user.authorized_projects.accessible_to(current_user)
@events = @user.recent_events.where(project_id: accessible_projects.pluck(:id)).limit(20)
@title = @user.name
end