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
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_list ⇒ Object
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 |
#title ⇒ Object
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_assigned ⇒ Object
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_read ⇒ Object
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 |