Sha256: 335b3175802818cddf2ca7bfb11cb3dde7a8cd3c8abe5a6befe951bed5d2e782
Contents?: true
Size: 752 Bytes
Versions: 36
Compression:
Stored size: 752 Bytes
Contents
module Hyrax module DashboardHelperBehavior def on_the_dashboard? params[:controller].match(%r{^hyrax/dashboard|hyrax/my}) end def number_of_works(user = current_user) Hyrax::WorkRelation.new.where(DepositSearchBuilder.depositor_field => user.user_key).count rescue RSolr::Error::ConnectionRefused 'n/a' end def number_of_files(user = current_user) ::FileSet.where(DepositSearchBuilder.depositor_field => user.user_key).count rescue RSolr::Error::ConnectionRefused 'n/a' end def number_of_collections(user = current_user) ::Collection.where(DepositSearchBuilder.depositor_field => user.user_key).count rescue RSolr::Error::ConnectionRefused 'n/a' end end end
Version data entries
36 entries across 36 versions & 1 rubygems