I'm having trouble with postgres syntax.
My code is as follows:
output = Course.select("DISTINCT courses.*").where(:semester => Semester.current_semester(input[:semester])).where(:pending => pending)
output = Section.need_to_filter(input) ? output.joins(:sections) : output.joins("LEFT JOIN sections")
output = output.where(:category => input[:category]) if input[:category]
output = output.where('title ILIKE ?', "%#{input[:search_field]}%") if !input[:search_field].blank?
And here's the error image
It has something to do with the join, because that's where it stops, but since I have sqlite3 in development I'm not sure how to test it efficiently.
Can anyone help?
LEFT JOIN
withoutON
orUSING
.