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



44
45
46
47
48
49
50
# File 'app/models/task.rb', line 44

def complete_participant_list
  task_statuses.collect do |status|
    unless status.completed_at.nil?
      status.participant
    end
  end
end

#incomplete_participant_listObject



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

def incomplete_participant_list
  task_statuses.collect do |status|
    if status.completed_at.nil?
      status.participant
    end
  end
end

#titleObject



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

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.



53
54
55
# File 'app/models/task.rb', line 53

def total_assigned
  task_statuses.count
end

#total_readObject

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



58
59
60
# File 'app/models/task.rb', line 58

def total_read
  task_statuses.where.not(completed_at: nil).count
end