Commit 9f011a08 authored by Zach Perkins's avatar Zach Perkins
Browse files

Made the section count for instructors only count sections in the current semester

parent 9b0290a3
Pipeline #3220 failed with stage
in 2 minutes and 10 seconds
......@@ -29,9 +29,10 @@ module SearchHelper
def self.fetch_instructors(query_data)
Instructor.from_name("instructors.*, COUNT( AS section_count"), query_data.search_string)
Instructor.from_name("instructors.*, COUNT( AS section_count").from("course_sections"), query_data.search_string)
.joins("LEFT OUTER JOIN instructors ON = course_sections.instructor_id")
.joins("LEFT OUTER JOIN courses ON = course_sections.course_id AND courses.semester_id = #{}")
def self.fetch_courses(query_data)
......@@ -17,8 +17,8 @@
<div class="card-body">
<div class="attr-list">
<div class="attr"><i class="fa fa-book"></i> 3 credits</div>
<div class="attr"><i class="fa fa-bars"></i> 3 sections</div>
<div class="attr"><i class="fa fa-book"></i> 3 credits</div> <!-- TODO: Make this work -->
<div class="attr"><i class="fa fa-bars"></i> <%= "#{course.section_count}" %> sections</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