gitlab-org--gitlab-foss/app/controllers/users_controller.rb
2013-01-22 19:45:13 +02:00

7 lines
318 B
Ruby

class UsersController < ApplicationController
def show
@user = User.find_by_username!(params[:username])
@projects = @user.authorized_projects.where('projects.id in (?)', current_user.authorized_projects.map(&:id))
@events = @user.recent_events.where(project_id: @projects.map(&:id)).limit(20)
end
end