Skip to content

Commit

Permalink
Fix double-counting bug in query
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Jul 10, 2024
1 parent 1d78beb commit b52df91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/finish_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.sql(event_id:)
left join course_group_courses on course_group_courses.course_id = events.course_id
left join course_groups on course_groups.id = course_group_courses.course_group_id
left join course_group_courses all_cgc on all_cgc.course_group_id = course_groups.id
join events relevant_events on (relevant_events.course_id = all_cgc.course_id or relevant_events.course_id = events.course_id)
join events relevant_events on (relevant_events.course_id = coalesce(all_cgc.course_id, events.course_id))
join efforts on efforts.event_id = relevant_events.id
join people on people.id = efforts.person_id
join effort_segments on effort_segments.effort_id = efforts.id
Expand Down

0 comments on commit b52df91

Please sign in to comment.