summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
blob: ddc7630f891e12f3eef24a88be218afa55c82fd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
class UsersController < ApplicationController
  layout 'navless'

  def show
    @user = User.find_by_username!(params[:username])
    @projects = @user.authorized_projects.where(id: current_user.authorized_projects.pluck(:id)).includes(:namespace)
    @events = @user.recent_events.where(project_id: @projects.map(&:id)).limit(20)

    @title = @user.name
  end
end