Skip to content

Commit

Permalink
add check for module release record to new mod method
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-coggin committed Nov 27, 2023
1 parent 2b4fe85 commit 2d3fa5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/services/course_progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def new_module?(mod)
return false if active?(mod) || completed?(mod)

mod_release = ModuleRelease.find_by(module_position: mod.position)
return false unless mod_release

last_visit = user.visits.order(started_at: :desc).second
last_visit.started_at < mod_release.first_published_at
end
Expand Down

0 comments on commit 2d3fa5b

Please sign in to comment.