Class: Task

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/task.rb

Overview

Gives participants notifications on what needs to be completed

Instance Method Summary collapse

Instance Method Details

#complete_participant_listObject



43
44
45
46
47
# File 'app/models/task.rb', line 43

def complete_participant_list
  Participant
    .joins(memberships: :task_statuses)
    .merge(task_statuses.non_moderator.completed)
end

#incomplete_participant_listObject



37
38
39
40
41
# File 'app/models/task.rb', line 37

def incomplete_participant_list
  Participant
    .joins(memberships: :task_statuses)
    .merge(task_statuses.non_moderator.incomplete)
end

#titleObject



32
33
34
35
# File 'app/models/task.rb', line 32

def title
  try(:bit_core_content_module).try(:pretty_title) ||
    try(:bit_core_content_module).try(:title)
end

#total_assignedObject

Returns a count of the number of times this task was assigned.



50
51
52
# File 'app/models/task.rb', line 50

def total_assigned
  task_statuses.non_moderator.count
end

#total_readObject

Returns the count of the number of times this task was completed.



55
56
57
# File 'app/models/task.rb', line 55

def total_read
  task_statuses.non_moderator.completed.count
end