Module: Dorsale::Flyboy::TasksSummaryConcern

Extended by:
ActiveSupport::Concern
Included in:
TasksController
Defined in:
app/controllers/dorsale/flyboy/concerns/tasks_summary.rb

Instance Method Summary collapse

Instance Method Details

#setup_tasks_summaryObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/dorsale/flyboy/concerns/tasks_summary.rb', line 6

def setup_tasks_summary
  tasks = current_user_scope.tasks.where("(owner_id IS NULL and owner_type IS NULL) OR (owner_id = ? and owner_type = ?)", current_user.id, current_user.class)

  @delayed_tasks        = tasks.delayed
  @today_tasks          = tasks.today
  @tomorrow_tasks       = tasks.tomorrow
  @this_week_tasks      = tasks.this_week
  @next_week_tasks      = tasks.next_week
  @next_next_week_tasks = tasks.next_next_week
end