Module: Course::LessonPlan::ItemTodoConcern

Extended by:
ActiveSupport::Concern
Included in:
Item
Defined in:
app/models/concerns/course/lesson_plan/item_todo_concern.rb

Instance Method Summary collapse

Instance Method Details

#can_user_start?(user) ⇒ Boolean

Returns:

  • (Boolean)

13
14
15
# File 'app/models/concerns/course/lesson_plan/item_todo_concern.rb', line 13

def can_user_start?(user)
  actable&.can_user_start?(user)
end

#create_todosObject

Create todos for the given lesson_plan_item for all course_users in the course.


18
19
20
21
# File 'app/models/concerns/course/lesson_plan/item_todo_concern.rb', line 18

def create_todos
  course_users = CourseUser.where(course_id: course_id)
  Course::LessonPlan::Todo.create_for!(self, course_users)
end

#has_todo?Boolean

Returns:

  • (Boolean)

9
10
11
# File 'app/models/concerns/course/lesson_plan/item_todo_concern.rb', line 9

def has_todo?
  actable&.class&.has_todo?
end