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

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
15
16
17
# 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

  # TODO: Comment out after adding timestamp columns
  # @this_month_customers = Comable::Customer.with_role(:customer).this_month
  # @this_week_customers = Comable::Customer.with_role(:customer).this_week
  # @last_week_customers = Comable::Customer.with_role(:customer).last_week
  # authorize! :read, @this_week_customers
end