Class: Comable::Admin::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/comable/admin/dashboard_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability, #respond_to_export_with

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/comable/admin/dashboard_controller.rb', line 6

def show
  @this_month_orders = Comable::Order.this_month
  @this_week_orders = Comable::Order.this_week
  @last_week_orders = Comable::Order.last_week
  authorize! :read, @this_month_orders

  @this_month_users = Comable::User.with_role(:customer).this_month
  @this_week_users = Comable::User.with_role(:customer).this_week
  @last_week_users = Comable::User.with_role(:customer).last_week
  authorize! :read, @this_week_users
end