diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 20bda61e..b46ab52b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -281,12 +281,11 @@ class CoursesController < ApplicationController if @school_id == "0" or @school_id.nil? @courses_all = Course.active.visible. joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). - where("#{Course.table_name}.course_type = ? ", Course::CourseType_course) else @courses_all = Course.active.visible. joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). joins(:course_extra). - where("#{Course.table_name}.course_type = ? AND #{Course.table_name}.school_id = ?", Course::CourseType_course, @school_id) + where("#{Course.table_name}.school_id = ?", @school_id) end @course_count = @courses_all.count @@ -407,8 +406,7 @@ class CoursesController < ApplicationController else @courses_all = Course.active.visible. joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). - joins(:course_extra). - where("#{Course.table_name}.course_type = ? AND #{Course.table_name}.school_id = ?", Course::CourseType_course, @school_id) + where("#{Course.table_name}.school_id = ?", @school_id) end @course_count = @courses_all.count