Commit fa9ffff2 authored by Zac Wood's avatar Zac Wood

Merge branch 'dev-v2' of git.gmu.edu:srct/schedules into dev-v2

parents 84a72fab e0f73f5a
Pipeline #3223 passed with stage
in 2 minutes and 11 seconds
......@@ -29,10 +29,10 @@ module SearchHelper
end
def self.fetch_instructors(query_data)
Instructor
.from_name(Instructor.select("instructors.*, COUNT(course_sections.id) AS section_count"), query_data.search_string)
.left_outer_joins(:course_sections)
.group("instructors.id")
Instructor.from_name(Instructor.select("instructors.*, COUNT(courses.id) AS section_count").from("course_sections"), query_data.search_string)
.joins("LEFT OUTER JOIN instructors ON instructors.id = course_sections.instructor_id")
.joins("LEFT OUTER JOIN courses ON courses.id = course_sections.course_id AND courses.semester_id = #{query_data.semester.id}")
.group("instructors.id").all
end
def self.fetch_courses(query_data)
......
......@@ -28,7 +28,8 @@
<div class="icon">
<i class="fa fa-bars"></i>
</div>
3 sections
<!-- TODO: FIX THIS -->
<%#= "#{course.section_count}" %> 3 sections
</div>
</div>
<p class="description"><%= course.description %></p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment