Class: Task
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Task
- Defined in:
- app/models/task.rb
Overview
Gives participants notifications on what needs to be completed
Instance Method Summary collapse
- #complete_participant_list ⇒ Object
- #incomplete_participant_list ⇒ Object
- #title ⇒ Object
-
#total_assigned ⇒ Object
Returns a count of the number of times this task was assigned.
-
#total_read ⇒ Object
Returns the count of the number of times this task was completed.
Instance Method Details
#complete_participant_list ⇒ Object
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_list ⇒ Object
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 |
#title ⇒ Object
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_assigned ⇒ Object
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_read ⇒ Object
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 |