users_controller.rb 368 Bytes
Newer Older
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
1
class UsersController < ApplicationController
2 3
  layout 'navless'

Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
4
  def show
5
    @user = User.find_by!(username: params[:username])
6
    @projects = @user.authorized_projects.where(id: current_user.authorized_projects.pluck(:id)).includes(:namespace)
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
7
    @events = @user.recent_events.where(project_id: @projects.map(&:id)).limit(20)
8 9

    @title = @user.name
Dmytro Zaporozhets's avatar
Dmytro Zaporozhets committed
10 11
  end
end