Sha256: 1b4410d1f090b0361cca12839694b7463ed10628c609d0a46866f24448f1b44d

Contents?: true

Size: 673 Bytes

Versions: 20

Compression:

Stored size: 673 Bytes

Contents

module Hyrax
  module Admin
    class UsersPresenter
      # @return [Array] an array of Users
      def users
        @users ||= search
      end

      # @return [Number] quantity of users excluding the system users and guest_users
      def user_count
        users.count
      end

      # @return [Array] an array of user roles
      def user_roles(user)
        user.groups
      end

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

      private

        # Returns a list of users excluding the system users and guest_users
        def search
          ::User.registered.without_system_accounts
        end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hyrax-2.0.3 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.2.0 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0.rc4 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0.rc3 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0.rc2 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0.rc1 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0.beta2 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.2 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.1.0.beta1 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.1 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.rc3 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.rc2 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.rc1 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.beta5 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.beta4 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.beta3 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.beta2 app/presenters/hyrax/admin/users_presenter.rb
hyrax-2.0.0.beta1 app/presenters/hyrax/admin/users_presenter.rb