Class: Hyrax::Admin::UsersPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/hyrax/admin/users_presenter.rb

Instance Method Summary collapse

Instance Method Details

#last_accessed(user) ⇒ Object



20
21
22
# File 'app/presenters/hyrax/admin/users_presenter.rb', line 20

def last_accessed(user)
  user. || user.created_at
end

#show_last_access?Boolean

return [Boolean] true if the devise trackable module is enabled.

Returns:

  • (Boolean)


25
26
27
28
# File 'app/presenters/hyrax/admin/users_presenter.rb', line 25

def show_last_access?
  return @show_last_access unless @show_last_access.nil?
  @show_last_access = ::User.devise_modules.include?(:trackable)
end

#user_countNumber

Returns quantity of users excluding the system users and guest_users.

Returns:

  • (Number)

    quantity of users excluding the system users and guest_users



11
12
13
# File 'app/presenters/hyrax/admin/users_presenter.rb', line 11

def user_count
  users.count
end

#user_roles(user) ⇒ Array

Returns an array of user roles.

Returns:

  • (Array)

    an array of user roles



16
17
18
# File 'app/presenters/hyrax/admin/users_presenter.rb', line 16

def user_roles(user)
  user.groups
end

#usersArray

Returns an array of Users.

Returns:

  • (Array)

    an array of Users



6
7
8
# File 'app/presenters/hyrax/admin/users_presenter.rb', line 6

def users
  @users ||= search
end