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



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

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

#incomplete_participant_listObject



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

def incomplete_participant_list
  task_statuses.collect do |status|
    if status.completed_at.nil?
      status.participant
    end
  end
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.



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

def total_assigned
  task_statuses.count
end

#total_readObject

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



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

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