Class: UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Methods included from ApplicationSignInCallbacksConcern

#sign_in

Methods included from ApplicationPaginationConcern

#page_param

Methods included from ApplicationAnnouncementsConcern

#global_announcements, #unread_global_announcements

Methods included from ApplicationInstanceUserConcern

#current_instance_user

Methods included from ApplicationUserTimeZoneConcern

#set_time_zone

Methods included from ApplicationUserConcern

#handle_access_denied, #publicly_accessible?

Methods included from ApplicationComponentsConcern

#handle_component_not_found

Instance Method Details

#showObject


5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/users_controller.rb', line 5

def show
  if @user.built_in?
    render file: 'public/404', layout: false, status: :not_found
  else
    course_users =
      @user.course_users.with_course_statistics.from_instance(current_tenant).includes(:course)
    @current_course_users = course_users.merge(Course.current)
    @completed_course_users = course_users.merge(Course.completed)
    @instances = other_instances
  end
end