Class: Workarea::Admin::Dashboards::IndexViewModel

Inherits:
ApplicationViewModel
  • Object
show all
Includes:
InsightsGraphs
Defined in:
app/view_models/workarea/admin/dashboards/index_view_model.rb

Instance Method Summary collapse

Methods included from InsightsGraphs

#ends_at, #previous_ends_at, #previous_starts_at, #starts_at

Instance Method Details

#insightsObject



20
21
22
23
24
# File 'app/view_models/workarea/admin/dashboards/index_view_model.rb', line 20

def insights
  @insights ||= InsightViewModel.wrap(
    Workarea::Insights::Base.all.page(options[:page])
  )
end

#todayObject



12
13
14
# File 'app/view_models/workarea/admin/dashboards/index_view_model.rb', line 12

def today
  @today ||= Workarea::Metrics::SalesByDay.today
end

#yesterdayObject



16
17
18
# File 'app/view_models/workarea/admin/dashboards/index_view_model.rb', line 16

def yesterday
  @yesterday ||= Workarea::Metrics::SalesByDay.yesterday
end