Skip to content

Commit ae1b259

Browse files
committed
Make sql less ambiguous when getting unlocks
1 parent bff1c6b commit ae1b259

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/controllers/api/v8/courses/exercises_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def index
4545
exercises = if unlocked_exercises.empty?
4646
exercises.where(unlock_spec: nil)
4747
else
48-
exercises.where(["unlock_spec IS NULL OR name IN (#{unlocked_exercises.map { |_| '?' }.join(', ')})", *unlocked_exercises])
48+
exercises.where(["unlock_spec IS NULL OR exercises.name IN (#{unlocked_exercises.map { |_| '?' }.join(', ')})", *unlocked_exercises])
4949
end
5050
end
5151

lib/course_info.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def course_data_core_api(course)
4444
exercises = if @unlocked_exercises.empty?
4545
exercises.where(unlock_spec: nil)
4646
else
47-
exercises.where(["unlock_spec IS NULL OR name IN (#{@unlocked_exercises.map {|_| '?'}.join(', ')})", *@unlocked_exercises])
47+
exercises.where(["unlock_spec IS NULL OR exercises.name IN (#{@unlocked_exercises.map {|_| '?'}.join(', ')})", *@unlocked_exercises])
4848
end.select { |e| e._fast_visible_to?(@user)}
4949
end
5050

0 commit comments

Comments
 (0)