Class: RailsExecution::DashboardsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/rails_execution/dashboards_controller.rb

Instance Method Summary collapse

Methods included from PolicyHelper

#can_close_task?, #can_create_task?, #can_edit_task?, #can_execute_task?, #display_decide?, #display_owner?, #display_reviewers?, #how_to_executable, #in_solo_mode?, #show_form_sidebar?

Methods included from BaseHelper

#current_owner

Instance Method Details

#homeObject



6
7
8
9
# File 'app/controllers/rails_execution/dashboards_controller.rb', line 6

def home
  @in_processing_count = ::RailsExecution::Task.processing.count
  @tasks_count = ::RailsExecution::Task.group(:status).count
end

#insightsObject



11
12
13
14
15
16
17
# File 'app/controllers/rails_execution/dashboards_controller.rb', line 11

def insights
  @tasks_by_week = ::RailsExecution::Task
    .where(created_at: 10.weeks.ago.beginning_of_day..Time.current)
    .group('YEAR(created_at)', 'WEEK(created_at)')
    .count
  respond_to(&:json)
end