Class: Hyrax::Admin::DashboardPresenter

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

Instance Method Summary collapse

Instance Method Details

#repository_growth(start_date, end_date) ⇒ Object



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

def repository_growth(start_date, end_date)
  @repository_growth ||= Admin::RepositoryGrowthPresenter.new(start_date, end_date)
end

#repository_objectsObject



12
13
14
# File 'app/presenters/hyrax/admin/dashboard_presenter.rb', line 12

def repository_objects
  @repository_objects ||= Admin::RepositoryObjectPresenter.new
end

#user_activity(start_date, end_date) ⇒ Object



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

def user_activity(start_date, end_date)
  @user_activity ||= Admin::UserActivityPresenter.new(start_date, end_date)
end

#user_count(start_date, end_date) ⇒ Fixnum

Returns the number of currently registered users.

Returns:

  • (Fixnum)

    the number of currently registered users



6
7
8
9
10
# File 'app/presenters/hyrax/admin/dashboard_presenter.rb', line 6

def user_count(start_date, end_date)
  ::User.where(guest: false)
        .where({ created_at: start_date.to_date.beginning_of_day..end_date.to_date.end_of_day })
        .count
end