Commit 7984e5b1efd430ce1ea1486c647f4beaa1c13e46
1 parent
b6f3f626
Exists in
spb-stable
and in
2 other branches
Show events from all projects on user page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/controllers/users_controller.rb
... | ... | @@ -11,7 +11,8 @@ class UsersController < ApplicationController |
11 | 11 | end |
12 | 12 | |
13 | 13 | @groups = @user.groups.accessible_to(current_user) |
14 | - @events = @user.recent_events.where(project_id: @projects.pluck(:id)).limit(20) | |
14 | + accessible_projects = @user.authorized_projects.accessible_to(current_user) | |
15 | + @events = @user.recent_events.where(project_id: accessible_projects.pluck(:id)).limit(20) | |
15 | 16 | @title = @user.name |
16 | 17 | end |
17 | 18 | ... | ... |