ami_models v0.1.6 Ami.Lesson
Link to this section Summary
Functions
Check if the lesson is completed or not
Helper checking if a lesson has got an 'Activity' resource
Pattern to fetch resources as lesson.resources with resourceable_type == "Lesson"
Because of better design patterns implemented by Ecto we cannot return lesson.videos to return correct videos. preload_videos implement a pattern which will return lesson.videos to return only videos with videoable_type == "Lesson" for the given lesson
Link to this section Functions
completed?(lesson, enrollment)
Check if the lesson is completed or not
has_activity?(lesson)
Helper checking if a lesson has got an 'Activity' resource
preload_resources(struct)
Pattern to fetch resources as lesson.resources with resourceable_type == "Lesson"
preload_videos(struct)
Because of better design patterns implemented by Ecto we cannot return lesson.videos to return correct videos. preload_videos implement a pattern which will return lesson.videos to return only videos with videoable_type == "Lesson" for the given lesson